diff options
author | Thibaut Girka <thib@sitedethib.com> | 2018-09-06 20:55:11 +0200 |
---|---|---|
committer | ThibG <thib@sitedethib.com> | 2018-09-07 20:37:17 +0200 |
commit | 324ce93368bbac88a5b53083c8932ec175450f55 (patch) | |
tree | 019a413b5d4b20bad7114081e1df5afe4f01fe53 /app/javascript/flavours/glitch/features/ui/components | |
parent | ba4521b175a2d0906e2a62e93e39cb80fa9286c9 (diff) |
Add preferences for notification badges
Diffstat (limited to 'app/javascript/flavours/glitch/features/ui/components')
-rw-r--r-- | app/javascript/flavours/glitch/features/ui/components/tabs_bar.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/app/javascript/flavours/glitch/features/ui/components/tabs_bar.js b/app/javascript/flavours/glitch/features/ui/components/tabs_bar.js index 6b9cf27e1..b44a21a42 100644 --- a/app/javascript/flavours/glitch/features/ui/components/tabs_bar.js +++ b/app/javascript/flavours/glitch/features/ui/components/tabs_bar.js @@ -8,20 +8,22 @@ import { connect } from 'react-redux'; const mapStateToProps = state => ({ unreadNotifications: state.getIn(['notifications', 'unread']), + showBadge: state.getIn(['local_settings', 'notifications', 'tab_badge']), }); @connect(mapStateToProps) class NotificationsIcon extends React.PureComponent { static propTypes = { unreadNotifications: PropTypes.number, + showBadge: PropTypes.bool, }; render() { - const { unreadNotifications } = this.props; + const { unreadNotifications, showBadge } = this.props; return ( <span className='icon-badge-wrapper'> <i className='fa fa-fw fa-bell' /> - { unreadNotifications > 0 && <div className='icon-badge' />} + { showBadge && unreadNotifications > 0 && <div className='icon-badge' />} </span> ); } |