Skip to content

Commit e44381f

Browse files
authored
Merge pull request #2964 from amedora/filter-tags-and-folders
Filter tags and folders
2 parents 216f588 + 2c0e0a6 commit e44381f

29 files changed

+301
-37
lines changed

browser/components/SideNavFilter.styl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.menu
2-
margin-bottom 30px
2+
margin-bottom 20px
33

44
.menu-button
55
navButtonColor()

browser/components/StorageList.styl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
.storageList
2-
absolute left right
3-
bottom 37px
4-
top 180px
2+
margin-bottom 37px
53
overflow-y auto
64

75
.storageList-folded

browser/main/SideNav/PreferenceButton.styl

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
.top-menu-preference
22
navButtonColor()
3-
position absolute
4-
top 22px
5-
right 10px
63
width 2em
74
background-color transparent
85
&:hover

browser/main/SideNav/SearchButton.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import PropTypes from 'prop-types'
2+
import React from 'react'
3+
import CSSModules from 'browser/lib/CSSModules'
4+
import styles from './SearchButton.styl'
5+
import i18n from 'browser/lib/i18n'
6+
7+
const SearchButton = ({ onClick, isActive }) => (
8+
<button styleName='top-menu-search' onClick={e => onClick(e)}>
9+
<img
10+
styleName='icon-search'
11+
src={
12+
isActive
13+
? '../resources/icon/icon-search-active.svg'
14+
: '../resources/icon/icon-search.svg'
15+
}
16+
/>
17+
<span styleName='tooltip'>{i18n.__('Search')}</span>
18+
</button>
19+
)
20+
21+
SearchButton.propTypes = {
22+
onClick: PropTypes.func.isRequired,
23+
isActive: PropTypes.bool
24+
}
25+
26+
export default CSSModules(SearchButton, styles)
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
.top-menu-search
2+
navButtonColor()
3+
position relative
4+
margin-right 6px
5+
top 3px
6+
width 2em
7+
background-color transparent
8+
&:hover
9+
color $ui-button-default--active-backgroundColor
10+
background-color transparent
11+
.tooltip
12+
opacity 1
13+
&:active, &:active:hover
14+
color $ui-button-default--active-backgroundColor
15+
16+
.icon-search
17+
width 16px
18+
19+
body[data-theme="white"]
20+
.top-menu-search
21+
navWhiteButtonColor()
22+
background-color transparent
23+
&:hover
24+
color #0B99F1
25+
background-color transparent
26+
&:active, &:active:hover
27+
color #0B99F1
28+
background-color transparent
29+
30+
body[data-theme="dark"]
31+
.top-menu-search
32+
navDarkButtonColor()
33+
background-color transparent
34+
&:active
35+
background-color alpha($ui-dark-button--active-backgroundColor, 20%)
36+
background-color transparent
37+
&:hover
38+
background-color alpha($ui-dark-button--active-backgroundColor, 20%)
39+
background-color transparent
40+
41+
42+
43+
.tooltip
44+
tooltip()
45+
position absolute
46+
pointer-events none
47+
top 26px
48+
left -20px
49+
z-index 200
50+
padding 5px
51+
line-height normal
52+
border-radius 2px
53+
opacity 0
54+
transition 0.1s
55+
white-space nowrap

browser/main/SideNav/SideNav.styl

Lines changed: 64 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,47 @@
99
flex-direction column
1010

1111
.top
12-
padding-bottom 15px
12+
display flex
13+
align-items top
14+
justify-content space-between
15+
padding-bottom 10px
16+
margin 14px 14px 4px
1317

1418
.switch-buttons
1519
background-color transparent
1620
border 0
17-
margin 24px auto 4px 14px
1821
display flex
22+
align-items center
1923
text-align center
2024

25+
.extra-buttons
26+
position relative
27+
display flex
28+
align-items center
2129

30+
.search
31+
position relative
32+
flex 1
33+
display flex
34+
max-height 0
35+
overflow hidden
36+
transition max-height .4s
37+
margin -5px 10px 0
38+
.search-input
39+
flex 1
40+
height 2em
41+
vertical-align middle
42+
font-size 14px
43+
border solid 1px $border-color
44+
border-radius 2px
45+
padding 2px 6px
46+
outline none
47+
.search-clear
48+
width 10px
49+
position absolute
50+
right 8px
51+
top 9px
52+
cursor pointer
2253

2354
.top-menu-label
2455
margin-left 5px
@@ -68,8 +99,15 @@
6899
background-color #2E3235
69100
.switch-buttons
70101
display none
102+
.extra-buttons > button:first-of-type // hide search icon
103+
display none
71104
.top
72105
height 60px
106+
align-items center
107+
margin 0
108+
justify-content center
109+
position relative
110+
left -4px
73111
.top-menu
74112
position static
75113
width $sideNav--folded-width
@@ -98,17 +136,35 @@
98136
.top-menu-preference
99137
position absolute
100138
left 7px
139+
.search
140+
height 28px
141+
.search-input
142+
display none
143+
.search-clear
144+
display none
145+
.search-folded
146+
width 16px
147+
padding-left 4px
148+
margin-bottom 8px
149+
cursor pointer
101150

102151
body[data-theme="white"]
103152
.root, .root--folded
104153
background-color #f9f9f9
105154
color $ui-text-color
155+
.search .search-input
156+
background-color #f9f9f9
157+
color $ui-text-color
106158

107159
body[data-theme="dark"]
108160
.root, .root--folded
109161
border-right 1px solid $ui-dark-borderColor
110162
background-color $ui-dark-backgroundColor
111163
color $ui-dark-text-color
164+
.search .search-input
165+
background-color $ui-dark-backgroundColor
166+
color $ui-dark-text-color
167+
border-color $ui-dark-borderColor
112168

113169
.top
114170
border-color $ui-dark-borderColor
@@ -119,8 +175,13 @@ apply-theme(theme)
119175
background-color get-theme-var(theme, 'backgroundColor')
120176
border-right 1px solid get-theme-var(theme, 'borderColor')
121177

178+
.search .search-input
179+
background-color get-theme-var(theme, 'backgroundColor')
180+
color get-theme-var(theme, 'text-color')
181+
border-color get-theme-var(theme, 'borderColor')
182+
122183
for theme in 'solarized-dark' 'dracula'
123184
apply-theme(theme)
124185

125186
for theme in $themes
126-
apply-theme(theme)
187+
apply-theme(theme)

0 commit comments

Comments
 (0)