Skip to content

Commit 5c54983

Browse files
committed
add searchbar to sketches dashboard view, adjust sketch list and asset list styling to have sticky header
1 parent 5900e62 commit 5c54983

File tree

7 files changed

+48
-5
lines changed

7 files changed

+48
-5
lines changed

client/modules/IDE/components/Searchbar.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class Searchbar extends React.Component {
5858
className="searchbar__input"
5959
type="text"
6060
value={searchValue}
61-
placeholder="Search files..."
61+
placeholder="Search sketches..."
6262
onChange={this.handleSearchChange}
6363
onKeyUp={this.handleSearchEnter}
6464
/>

client/modules/User/pages/DashboardView.jsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import Nav from '../../../components/Nav';
99

1010
import AssetList from '../../IDE/components/AssetList';
1111
import SketchList from '../../IDE/components/SketchList';
12+
import Searchbar from '../../IDE/components/Searchbar';
1213

1314
import DashboardTabSwitcher, { TabKey } from '../components/DashboardTabSwitcher';
1415

@@ -75,6 +76,7 @@ class DashboardView extends React.Component {
7576
<h2 className="dashboard-header__header__title">{this.ownerName()}</h2>
7677

7778
<DashboardTabSwitcher currentTab={currentTab} isOwner={isOwner} username={username} />
79+
{ currentTab === TabKey.sketches && <Searchbar /> }
7880
</div>
7981

8082
<div className="dashboard-content">

client/styles/components/_asset-list.scss

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
.asset-table {
99
width: 100%;
10-
padding: #{10 / $base-font-size}rem 0;
10+
padding-bottom: #{10 / $base-font-size}rem;
1111
max-height: 100%;
1212
border-spacing: 0;
1313
& .asset-list__delete-column {
@@ -22,8 +22,15 @@
2222
}
2323

2424
& th {
25+
padding-top: #{10 / $base-font-size}rem;
26+
padding-bottom: #{15 / $base-font-size}rem;
2527
height: #{32 / $base-font-size}rem;
2628
font-weight: normal;
29+
position: sticky;
30+
top: #{15 / $base-font-size}rem;
31+
@include themify() {
32+
background-color: getThemifyVariable('background-color');
33+
}
2734
}
2835
}
2936

@@ -57,4 +64,9 @@
5764

5865
.asset-table__total {
5966
padding: 0 #{20 / $base-font-size}rem;
67+
position: sticky;
68+
top: 0;
69+
@include themify() {
70+
background-color: getThemifyVariable('background-color');
71+
}
6072
}

client/styles/components/_dashboard-header.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
.dashboard-header {
22
padding: #{24 / $base-font-size}rem #{66 / $base-font-size}rem;
3+
position: relative;
4+
flex: 1;
5+
overflow: hidden;
6+
display: flex;
7+
flex-direction:column;
38
}
49

510
.dashboard-header__tabs {

client/styles/components/_searchbar.scss

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
position: absolute;
33
display: flex;
44
padding-left: #{17 / $base-font-size}rem;
5-
right: #{50 / $base-font-size}rem;
6-
top: #{14 / $base-font-size}rem;
5+
right: #{66 / $base-font-size}rem;
6+
top: #{65 / $base-font-size}rem;
77
}
88

99
.searchbar__input {
@@ -18,15 +18,26 @@
1818
}
1919
}
2020

21-
.searchbar__button {
21+
button[type="submit"].searchbar__button {
22+
background-color: unset;
2223
width: #{31 / $base-font-size}rem;
2324
height: #{36 / $base-font-size}rem;
2425
position: absolute;
2526
padding: 0;
27+
border: 0;
2628
border-right: solid 1px;
2729
@include themify() {
2830
border-right-color: getThemifyVariable('input-border-color');
2931
}
32+
&:enabled:hover {
33+
background-color: unset;
34+
@include themify() {
35+
border-right-color: getThemifyVariable('input-border-color');
36+
}
37+
& g {
38+
fill: unset;
39+
}
40+
}
3041
}
3142

3243
.searchbar__icon {

client/styles/components/_sketch-list.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@
1717

1818
.sketches-table thead th {
1919
height: #{32 / $base-font-size}rem;
20+
position: sticky;
21+
top: 0;
22+
@include themify() {
23+
background-color: getThemifyVariable('background-color');
24+
}
2025
}
2126

2227
.sketch-list__sort-button {

client/styles/layout/_dashboard.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,12 @@
66
color: getThemifyVariable('primary-text-color');
77
background-color: getThemifyVariable('background-color');
88
}
9+
height: 100%;
10+
}
11+
12+
.dashboard-content {
13+
display: flex;
14+
flex-direction: column;
15+
flex: 1;
16+
overflow: hidden;
917
}

0 commit comments

Comments
 (0)