1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 01:36:22 +00:00

fix button style to change color when switch active/inactive

This commit is contained in:
Sosuke Suzuki
2017-09-30 17:51:41 +09:00
parent 06bd2b2b79
commit 59e5c547e9
2 changed files with 16 additions and 10 deletions

View File

@@ -13,14 +13,23 @@
height $topBar-height
padding 0 15px
font-size 12px
width 100%
text-align left
width 33%
text-align center
&:hover
color $ui-text-color
&:active, &:active:hover
color $ui-text-color
background-color alpha($ui-button--active-backgroundColor, 20%)
.switch-buttons button
width 33%
.active-button
background-color #c4c4c4
.non-active-button
background-color white
.top-menu-label
margin-left 5px
overflow ellipsis
@@ -127,4 +136,4 @@ body[data-theme="dark"]
&:hover
background-color alpha($ui-dark-button--active-backgroundColor, 20%)
transition 0.15s
color $ui-dark-text-color
color $ui-dark-text-color

View File

@@ -40,13 +40,11 @@ class SideNav extends React.Component {
}
handleSwitchFolderButtonClick (e) {
console.log('SwitchfolderButton Clicked')
let { router } = this.context
router.push('/home')
}
handleSwitchTagButtonClick (e) {
console.log('SwitchTagButton clicked')
let { router } = this.context
router.push('/alltags')
}
@@ -138,16 +136,15 @@ class SideNav extends React.Component {
tabIndex='1'
style={style}
>
<div styleName='SwitchModeButtons'>
<button onClick={(e) => this.handleSwitchFolderButtonClick(e)}>Folder</button>
<button onClick={(e) => this.handleSwitchTagButtonClick(e)}>Tags</button>
</div>
<div styleName='top'>
<div styleName='switch-buttons'>
<button styleName={location.pathname.match(/tag/) ? 'non-active-button' : 'active-button'} onClick={(e) => this.handleSwitchFolderButtonClick(e)}>Folder</button>
<button styleName={location.pathname.match(/tag/) ? 'active-button' : 'non-active-button'} onClick={(e) => this.handleSwitchTagButtonClick(e)}>Tags</button>
</div>
<button styleName='top-menu'
onClick={(e) => this.handleMenuButtonClick(e)}
>
<i className='fa fa-wrench fa-fw' />
<span styleName='top-menu-label'>Preferences</span>
</button>
</div>
{this.SideNavComponent(isFolded, isHomeActive, isTrashedActive, isStarredActive, storageList)}