mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 17:56:25 +00:00
Move condition of trash or not
This commit is contained in:
@@ -68,10 +68,7 @@ class NewNoteButton extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const { config, style, data, location } = this.props
|
const { config, style, data } = this.props
|
||||||
if (location.pathname === '/trashed') {
|
|
||||||
return ''
|
|
||||||
} else {
|
|
||||||
return (
|
return (
|
||||||
<div className='NewNoteButton'
|
<div className='NewNoteButton'
|
||||||
styleName={config.isSideNavFolded ? 'root--expanded' : 'root'}
|
styleName={config.isSideNavFolded ? 'root--expanded' : 'root'}
|
||||||
@@ -90,7 +87,6 @@ class NewNoteButton extends React.Component {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
NewNoteButton.propTypes = {
|
NewNoteButton.propTypes = {
|
||||||
dispatch: PropTypes.func,
|
dispatch: PropTypes.func,
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ class TopBar extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
let { config, style, data } = this.props
|
let { config, style, data, location } = this.props
|
||||||
return (
|
return (
|
||||||
<div className='TopBar'
|
<div className='TopBar'
|
||||||
styleName={config.isSideNavFolded ? 'root--expanded' : 'root'}
|
styleName={config.isSideNavFolded ? 'root--expanded' : 'root'}
|
||||||
@@ -108,7 +108,8 @@ class TopBar extends React.Component {
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<NewNoteButton
|
{location.pathname === '/trashed' ? ''
|
||||||
|
: <NewNoteButton
|
||||||
{..._.pick(this.props, [
|
{..._.pick(this.props, [
|
||||||
'dispatch',
|
'dispatch',
|
||||||
'data',
|
'data',
|
||||||
@@ -116,7 +117,7 @@ class TopBar extends React.Component {
|
|||||||
'params',
|
'params',
|
||||||
'location'
|
'location'
|
||||||
])}
|
])}
|
||||||
/>
|
/>}
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user