Updated FooterBar to show for everyone
• Updated: - FooterBar to show for everyone - notifications item to only show for logged in users
This commit is contained in:
parent
853b15a63e
commit
1e7977aaec
@ -4,8 +4,8 @@ import { CX } from '../constants'
|
|||||||
import Button from './button'
|
import Button from './button'
|
||||||
|
|
||||||
const mapStateToProps = (state) => ({
|
const mapStateToProps = (state) => ({
|
||||||
notificationCount: state.getIn(['notifications', 'unread']),
|
notificationCount: !!me ? state.getIn(['notifications', 'unread']) : 0,
|
||||||
homeItemsQueueCount: state.getIn(['timelines', 'home', 'totalQueuedItemsCount']),
|
homeItemsQueueCount: !!me ? state.getIn(['timelines', 'home', 'totalQueuedItemsCount']) : 0,
|
||||||
})
|
})
|
||||||
|
|
||||||
export default
|
export default
|
||||||
@ -19,6 +19,7 @@ class FooterBar extends PureComponent {
|
|||||||
|
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
notificationCount: PropTypes.number.isRequired,
|
notificationCount: PropTypes.number.isRequired,
|
||||||
|
homeItemsQueueCount: PropTypes.number.isRequired,
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
@ -26,7 +27,6 @@ class FooterBar extends PureComponent {
|
|||||||
notificationCount,
|
notificationCount,
|
||||||
homeItemsQueueCount,
|
homeItemsQueueCount,
|
||||||
} = this.props
|
} = this.props
|
||||||
if (!me) return false
|
|
||||||
|
|
||||||
const noRouter = !this.context.router
|
const noRouter = !this.context.router
|
||||||
const currentPathname = noRouter ? '' : this.context.router.route.location.pathname
|
const currentPathname = noRouter ? '' : this.context.router.route.location.pathname
|
||||||
@ -42,6 +42,7 @@ class FooterBar extends PureComponent {
|
|||||||
to: '/notifications',
|
to: '/notifications',
|
||||||
icon: 'notifications',
|
icon: 'notifications',
|
||||||
title: 'Notifications',
|
title: 'Notifications',
|
||||||
|
isHidden: !me,
|
||||||
active: currentPathname === '/notifications',
|
active: currentPathname === '/notifications',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -64,6 +65,8 @@ class FooterBar extends PureComponent {
|
|||||||
<div className={[_s.default, _s.flexRow, _s.alignItemsCenter, _s.height100PC, _s.heightMin58PX, _s.saveAreaInsetPB, _s.justifyContentSpaceAround].join(' ')}>
|
<div className={[_s.default, _s.flexRow, _s.alignItemsCenter, _s.height100PC, _s.heightMin58PX, _s.saveAreaInsetPB, _s.justifyContentSpaceAround].join(' ')}>
|
||||||
{
|
{
|
||||||
buttons.map((props) => {
|
buttons.map((props) => {
|
||||||
|
if (props.isHidden) return null
|
||||||
|
|
||||||
const classes = CX({
|
const classes = CX({
|
||||||
borderTop2PX: 1,
|
borderTop2PX: 1,
|
||||||
borderColorTransparent: !props.active,
|
borderColorTransparent: !props.active,
|
||||||
@ -118,4 +121,5 @@ class FooterBar extends PureComponent {
|
|||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user