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

Commit c04fdf1

Browse files
ericawrightjasonLaster
authored andcommitted
Remove unused parts of the welcome box and restyle with flexbox (#5348)
1 parent 4263255 commit c04fdf1

File tree

2 files changed

+27
-50
lines changed

2 files changed

+27
-50
lines changed

src/components/WelcomeBox.css

Lines changed: 24 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,6 @@
2323
background-color: var(--theme-body-background);
2424
}
2525

26-
.alignlabel {
27-
display: inline-block;
28-
}
29-
30-
.welcomebox .normal-layout {
31-
display: none;
32-
}
33-
3426
.welcomebox .command-bar-button {
3527
position: absolute;
3628
top: auto;
@@ -39,43 +31,42 @@
3931
bottom: 0;
4032
}
4133

34+
.alignlabel {
35+
display: flex;
36+
white-space: nowrap;
37+
}
38+
4239
.shortcutKeys {
43-
text-align: right;
44-
float: left;
4540
font-family: Courier;
4641
}
4742

43+
.shortcutKey,
44+
.shortcutLabel {
45+
flex: 1;
46+
overflow: hidden;
47+
text-overflow: ellipsis;
48+
}
49+
4850
.shortcutKey {
49-
display: inline-block;
50-
margin-right: 10px;
51+
text-align: right;
52+
padding-right: 10px;
5153
font-family: Courier;
5254
}
5355

54-
.shortcutFunction {
56+
.shortcutLabel {
5557
text-align: left;
56-
float: left;
57-
margin-left: 25px;
58-
color: var(--theme-comment);
58+
padding-left: 10px;
5959
}
6060

61-
html .welcomebox .toggle-button-end.collapsed {
62-
bottom: 1px;
61+
.shortcutFunction {
62+
flex: 1;
63+
color: var(--theme-comment);
6364
}
6465

65-
@media (max-width: 430px) {
66-
.welcomebox .small-size-layout {
67-
display: inline-block;
68-
}
69-
70-
.welcomebox .normal-layout {
71-
display: none;
72-
}
73-
74-
.shortcutFunction {
75-
margin-left: 0;
76-
}
66+
.shortcutFunction p {
67+
display: flex;
68+
}
7769

78-
.shortcutKey {
79-
display: block;
80-
}
70+
html .welcomebox .toggle-button-end.collapsed {
71+
bottom: 1px;
8172
}

src/components/WelcomeBox.js

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -57,33 +57,19 @@ class WelcomeBox extends Component<Props> {
5757

5858
return (
5959
<div className="welcomebox">
60-
<div className="alignlabel small-size-layout">
60+
<div className="alignlabel">
6161
<div className="shortcutFunction">
6262
<p onClick={() => openQuickOpen()}>
6363
<span className="shortcutKey">{searchSourcesShortcut}</span>
64-
{searchSourcesLabel}
64+
<span className="shortcutLabel">{searchSourcesLabel}</span>
6565
</p>
6666
<p onClick={setActiveSearch.bind(null, "project")}>
6767
<span className="shortcutKey">{searchProjectShortcut}</span>
68-
{searchProjectLabel}
68+
<span className="shortcutLabel">{searchProjectLabel}</span>
6969
</p>
7070
</div>
7171
{this.renderToggleButton()}
7272
</div>
73-
<div className="alignlabel normal-layout">
74-
<div className="shortcutKeys">
75-
<p onClick={() => openQuickOpen()}>{searchSourcesShortcut}</p>
76-
<p onClick={setActiveSearch.bind(null, "project")}>
77-
{searchProjectShortcut}
78-
</p>
79-
</div>
80-
<div className="shortcutFunction">
81-
<p onClick={() => openQuickOpen()}>{searchSourcesLabel}</p>
82-
<p onClick={setActiveSearch.bind(null, "project")}>
83-
{searchProjectLabel}
84-
</p>
85-
</div>
86-
</div>
8773
</div>
8874
);
8975
}

0 commit comments

Comments
 (0)