Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Responsive for mobile #1331

Merged
merged 5 commits into from
Feb 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions components/CopyMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ function CopyMenu({ isVisible, toggleVisibility, copyImage, carbonRef }) {
position: relative;
color: ${COLORS.SECONDARY};
flex: 1;
max-width: 40px;
}

.copy-row {
Expand Down
53 changes: 32 additions & 21 deletions components/Editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -345,25 +345,27 @@ class Editor extends React.Component {
onChange={this.updateLanguage}
/>
<div className="toolbar-second-row">
<BackgroundSelect
onChange={this.updateBackground}
updateHighlights={this.updateHighlights}
mode={backgroundMode}
color={backgroundColor}
image={backgroundImage}
carbonRef={this.carbonNode.current}
/>
<Settings
{...config}
onChange={this.updateSetting}
resetDefaultSettings={this.resetDefaultSettings}
format={this.format}
applyPreset={this.applyPreset}
getCarbonImage={this.getCarbonImage}
/>
<div id="style-editor-button" />
<div className="buttons">
<div className="setting-buttons">
<BackgroundSelect
onChange={this.updateBackground}
updateHighlights={this.updateHighlights}
mode={backgroundMode}
color={backgroundColor}
image={backgroundImage}
carbonRef={this.carbonNode.current}
/>
<Settings
{...config}
onChange={this.updateSetting}
resetDefaultSettings={this.resetDefaultSettings}
format={this.format}
applyPreset={this.applyPreset}
getCarbonImage={this.getCarbonImage}
/>
<CopyMenu copyImage={this.copyImage} carbonRef={this.carbonNode.current} />
</div>
<div id="style-editor-button" />
<div className="share-buttons">
<ShareMenu tweet={this.tweet} imgur={this.imgur} />
<ExportMenu
onChange={this.updateSetting}
Expand Down Expand Up @@ -414,23 +416,32 @@ class Editor extends React.Component {
padding: 16px;
}

.buttons {
.share-buttons,
.setting-buttons {
display: flex;
margin-left: auto;
height: 40px;
}
.toolbar-second-row {
height: 40px;
display: flex;
flex: 1 1 auto;
}
.toolbar-second-row > :global(div:not(:last-of-type)) {
.setting-buttons > :global(div) {
margin-right: 0.5rem;
}

#style-editor-button {
display: flex;
align-items: center;
}
@media (max-width: 768px) {
.toolbar-second-row {
display: block;
}
#style-editor-button {
margin-top: 0.5rem;
}
}
`}
</style>
</div>
Expand Down
6 changes: 5 additions & 1 deletion components/ExportMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,11 @@ function ExportMenu({ onChange, exportSize, isVisible, toggleVisibility, exportI
onClick={toggleVisibility}
data-cy="export-button"
margin="0 0 0 -1px"
style={{ borderBottomLeftRadius: 0, borderTopLeftRadius: 0 }}
style={{
borderBottomLeftRadius: 0,
borderTopLeftRadius: 0,
maxWidth: '26px',
}}
title="Export menu dropdown"
>
<ArrowDown color={COLORS.PURPLE} />
Expand Down
7 changes: 7 additions & 0 deletions components/Page.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,17 @@ class Page extends React.Component {
top: 1.4rem;
right: 1rem;
}
.page {
max-width: 100%;
padding: 0 1rem;
}
@media (min-width: 1024px) {
.main {
${COLUMN};
}
.page {
padding: 0;
}
}
`}
</style>
Expand Down
1 change: 1 addition & 0 deletions components/Popout.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ class Popout extends React.PureComponent {
border-radius: 3px;
margin-top: 10px;
font-size: 12px;
z-index: 1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we just make this z-index even higher? Like 999?

}
`}
</style>
Expand Down
6 changes: 5 additions & 1 deletion components/ShareMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,11 @@ function ShareMenu({ isVisible, toggleVisibility, tweet, imgur }) {
margin="0 8px 0 -1px"
onClick={toggleVisibility}
data-cy="share-button"
style={{ borderBottomLeftRadius: 0, borderTopLeftRadius: 0 }}
style={{
borderBottomLeftRadius: 0,
borderTopLeftRadius: 0,
maxWidth: '26px',
}}
title="Share menu dropdown"
>
<ArrowDown color={COLORS.BLUE} />
Expand Down