Add unread notifications badge to the navigation bar

This commit is contained in:
Thibaut Girka
2018-09-06 19:17:14 +02:00
committed by ThibG
parent 0f155af32a
commit 2cdc00bc8b
3 changed files with 28 additions and 1 deletions

View File

@@ -34,6 +34,7 @@ const mapStateToProps = state => ({
searchHidden: state.getIn(['search', 'hidden']),
searchValue: state.getIn(['search', 'value']),
submitted: state.getIn(['search', 'submitted']),
unreadNotifications: state.getIn(['notifications', 'unread']),
});
// Dispatch mapping.
@@ -87,6 +88,7 @@ class Drawer extends React.Component {
searchValue,
submitted,
isSearchPage,
unreadNotifications,
} = this.props;
const computedClass = classNames('drawer', `mbstobon-${elefriend}`);
@@ -96,6 +98,7 @@ class Drawer extends React.Component {
{multiColumn ? (
<DrawerHeader
columns={columns}
unreadNotifications={unreadNotifications}
intl={intl}
onSettingsClick={onOpenSettings}
/>
@@ -139,6 +142,7 @@ Drawer.propTypes = {
searchHidden: PropTypes.bool,
searchValue: PropTypes.string,
submitted: PropTypes.bool,
unreadNotifications: PropTypes.number,
// Dispatch props.
onChange: PropTypes.func,