diff --git a/app/gabsocial/components/helmet.js b/app/gabsocial/components/helmet.js index 5ed4c03bf..27bdb6591 100644 --- a/app/gabsocial/components/helmet.js +++ b/app/gabsocial/components/helmet.js @@ -5,6 +5,7 @@ import { Helmet } from'react-helmet'; const mapStateToProps = state => ({ siteTitle: state.getIn(['instance', 'title']), + unreadCount: state.getIn(['notifications', 'unread']), }); class SoapboxHelmet extends React.Component { @@ -12,15 +13,22 @@ class SoapboxHelmet extends React.Component { static propTypes = { siteTitle: PropTypes.string, children: PropTypes.node, + unreadCount: PropTypes.number, }; + addCounter = title => { + const { unreadCount } = this.props; + if (unreadCount < 1) return title; + return `(${unreadCount}) ${title}`; + } + render() { const { siteTitle, children } = this.props; return ( {children}