1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 17:56:25 +00:00

Merge pull request #906 from sferra/fix-collapse-sidebar-button-not-visible

Align notification bar with the navigation bar
This commit is contained in:
Kazu Yokomizo
2017-09-26 13:02:24 +09:00
committed by GitHub
3 changed files with 22 additions and 8 deletions

View File

@@ -45,7 +45,7 @@ class RealtimeNotification extends React.Component {
: '' : ''
return ( return (
<div styleName='notification-area'>{link}</div> <div styleName='notification-area' style={this.props.style}>{link}</div>
) )
} }
} }

View File

@@ -3,21 +3,21 @@
font-size 12px font-size 12px
position absolute position absolute
bottom 0px bottom 0px
right 0px
background-color #EBEBEB background-color #EBEBEB
width 100vw
height 30px height 30px
line-height 30px
text-align center text-align center
.notification-link .notification-link
display inline-block
line-height normal
text-decoration none text-decoration none
color #282A36 color #282A36
border 1px solid #6FA8E6 border 1px solid #6FA8E6
background-color alpha(#6FA8E6, 0.2) background-color alpha(#6FA8E6, 0.2)
padding 3px 9px padding 3px 9px
border-radius 2px border-radius 2px
position absolute
bottom 4px
margin-left -10%
transition 0.2s transition 0.2s
&:hover &:hover
color #1378BD color #1378BD

View File

@@ -21,6 +21,7 @@ function focused () {
} }
class Main extends React.Component { class Main extends React.Component {
constructor (props) { constructor (props) {
super(props) super(props)
@@ -189,6 +190,17 @@ class Main extends React.Component {
render () { render () {
let { config } = this.props let { config } = this.props
// the width of the navigation bar when it is folded/collapsed
const foldedNavigationWidth = 44
let notificationBarOffsetLeft
if (this.state.fullScreen) {
notificationBarOffsetLeft = 0
} else if (config.isSideNavFolded) {
notificationBarOffsetLeft = foldedNavigationWidth
} else {
notificationBarOffsetLeft = this.state.navWidth
}
return ( return (
<div <div
className='Main' className='Main'
@@ -217,7 +229,7 @@ class Main extends React.Component {
<div styleName={config.isSideNavFolded ? 'body--expanded' : 'body'} <div styleName={config.isSideNavFolded ? 'body--expanded' : 'body'}
id='main-body' id='main-body'
ref='body' ref='body'
style={{left: config.isSideNavFolded ? 44 : this.state.navWidth}} style={{left: config.isSideNavFolded ? foldedNavigationWidth : this.state.navWidth}}
> >
<TopBar style={{width: this.state.listWidth}} <TopBar style={{width: this.state.listWidth}}
{..._.pick(this.props, [ {..._.pick(this.props, [
@@ -256,7 +268,9 @@ class Main extends React.Component {
ignorePreviewPointerEvents={this.state.isRightSliderFocused} ignorePreviewPointerEvents={this.state.isRightSliderFocused}
/> />
</div> </div>
<RealtimeNotification /> <RealtimeNotification
style={{left: notificationBarOffsetLeft}}
/>
</div> </div>
) )
} }