Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Fix responsive issue on WelcomeBox #4119

Merged
merged 4 commits into from
Oct 2, 2017
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
34 changes: 34 additions & 0 deletions src/components/WelcomeBox.css
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,26 @@
offset-inline-start: auto;
}

.welcomebox .small-size-layout {
display: none;
}

.welcomebox .normal-layout {
display: inline-block;
}

.shortcutKeys {
text-align: right;
float: left;
font-family: Courier;
}

.shortcutKey {
display: inline-block;
margin-right: 10px;
font-family: Courier;
}

.shortcutFunction {
text-align: left;
float: left;
Expand All @@ -47,3 +61,23 @@
html .welcomebox .toggle-button-end.collapsed {
bottom: 1px;
}

@media (max-width: 430px) {

.welcomebox .small-size-layout {
display: inline-block;
}

.welcomebox .normal-layout {
display: none;
}

.shortcutFunction {
margin-left: 0;
}

.shortcutKey {
display: block;
}
}

16 changes: 14 additions & 2 deletions src/components/WelcomeBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,20 @@ class WelcomeBox extends Component {

return (
<div className="welcomebox">
<div className="alignlabel">
<div className="alignlabel small-size-layout">
<div className="shortcutFunction">
<p onClick={setActiveSearch.bind(null, "source")}>
<div className="shortcutKey">{searchSourcesShortcut}</div>
{searchSourcesLabel}
</p>
<p onClick={setActiveSearch.bind(null, "project")}>
<div className="shortcutKey">{searchProjectShortcut}</div>
{searchProjectLabel}
</p>
</div>
{this.renderToggleButton()}
</div>
<div className="alignlabel normal-layout">
<div className="shortcutKeys">
<p onClick={setActiveSearch.bind(null, "source")}>
{searchSourcesShortcut}
Expand All @@ -70,7 +83,6 @@ class WelcomeBox extends Component {
{searchProjectLabel}
</p>
</div>
{this.renderToggleButton()}
Copy link
Contributor

Choose a reason for hiding this comment

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

do we maybe still want this in the normal layout?

Copy link
Contributor

Choose a reason for hiding this comment

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

brilliant!

</div>
</div>
);
Expand Down