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

Filter tags and folders #2964

Merged
merged 13 commits into from
Feb 6, 2020
2 changes: 1 addition & 1 deletion browser/components/SideNavFilter.styl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.menu
margin-bottom 30px
margin-bottom 20px

.menu-button
navButtonColor()
Expand Down
4 changes: 1 addition & 3 deletions browser/components/StorageList.styl
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
.storageList
absolute left right
bottom 37px
top 180px
margin-bottom 37px
overflow-y auto

.storageList-folded
Expand Down
3 changes: 0 additions & 3 deletions browser/main/SideNav/PreferenceButton.styl
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
.top-menu-preference
navButtonColor()
position absolute
top 22px
right 10px
width 2em
background-color transparent
&:hover
Expand Down
26 changes: 26 additions & 0 deletions browser/main/SideNav/SearchButton.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import PropTypes from 'prop-types'
import React from 'react'
import CSSModules from 'browser/lib/CSSModules'
import styles from './SearchButton.styl'
import i18n from 'browser/lib/i18n'

const SearchButton = ({ onClick, isActive }) => (
<button styleName='top-menu-search' onClick={e => onClick(e)}>
<img
styleName='icon-search'
src={
isActive
? '../resources/icon/icon-search-active.svg'
: '../resources/icon/icon-search.svg'
}
/>
<span styleName='tooltip'>{i18n.__('Search')}</span>
</button>
)

SearchButton.propTypes = {
onClick: PropTypes.func.isRequired,
isActive: PropTypes.bool
}

export default CSSModules(SearchButton, styles)
55 changes: 55 additions & 0 deletions browser/main/SideNav/SearchButton.styl
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
.top-menu-search
navButtonColor()
position relative
margin-right 6px
top 3px
Copy link
Contributor

Choose a reason for hiding this comment

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

You've perfectly aligned the search glass to bottom (see first screenshot below). But I think it would be visually better to move it slightly up.

grafik

The following is with 2px as top
grafik

width 2em
background-color transparent
&:hover
color $ui-button-default--active-backgroundColor
background-color transparent
.tooltip
opacity 1
&:active, &:active:hover
color $ui-button-default--active-backgroundColor

.icon-search
width 16px

body[data-theme="white"]
.top-menu-search
navWhiteButtonColor()
background-color transparent
&:hover
color #0B99F1
background-color transparent
&:active, &:active:hover
color #0B99F1
background-color transparent

body[data-theme="dark"]
.top-menu-search
navDarkButtonColor()
background-color transparent
&:active
background-color alpha($ui-dark-button--active-backgroundColor, 20%)
background-color transparent
&:hover
background-color alpha($ui-dark-button--active-backgroundColor, 20%)
background-color transparent



.tooltip
tooltip()
position absolute
pointer-events none
top 26px
left -20px
z-index 200
padding 5px
line-height normal
border-radius 2px
opacity 0
transition 0.1s
white-space nowrap
67 changes: 64 additions & 3 deletions browser/main/SideNav/SideNav.styl
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,47 @@
flex-direction column

.top
padding-bottom 15px
display flex
align-items top
justify-content space-between
padding-bottom 10px
margin 14px 14px 4px

.switch-buttons
background-color transparent
border 0
margin 24px auto 4px 14px
display flex
align-items center
text-align center

.extra-buttons
position relative
display flex
align-items center

.search
position relative
flex 1
display flex
max-height 0
overflow hidden
transition max-height .4s
margin -5px 10px 0
.search-input
flex 1
height 2em
vertical-align middle
font-size 14px
border solid 1px $border-color
border-radius 2px
padding 2px 6px
outline none
.search-clear
width 10px
position absolute
right 8px
top 9px
cursor pointer

.top-menu-label
margin-left 5px
Expand Down Expand Up @@ -68,8 +99,15 @@
background-color #2E3235
.switch-buttons
display none
.extra-buttons > button:first-of-type // hide search icon
display none
.top
height 60px
align-items center
margin 0
justify-content center
position relative
left -4px
.top-menu
position static
width $sideNav--folded-width
Expand Down Expand Up @@ -98,17 +136,35 @@
.top-menu-preference
position absolute
left 7px
.search
height 28px
.search-input
display none
.search-clear
display none
.search-folded
width 16px
padding-left 4px
margin-bottom 8px
cursor pointer

body[data-theme="white"]
.root, .root--folded
background-color #f9f9f9
color $ui-text-color
.search .search-input
background-color #f9f9f9
color $ui-text-color

body[data-theme="dark"]
.root, .root--folded
border-right 1px solid $ui-dark-borderColor
background-color $ui-dark-backgroundColor
color $ui-dark-text-color
.search .search-input
background-color $ui-dark-backgroundColor
color $ui-dark-text-color
border-color $ui-dark-borderColor

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

.search .search-input
background-color get-theme-var(theme, 'backgroundColor')
color get-theme-var(theme, 'text-color')
border-color get-theme-var(theme, 'borderColor')

for theme in 'solarized-dark' 'dracula'
apply-theme(theme)

for theme in $themes
apply-theme(theme)
apply-theme(theme)
Loading