mgabdev 42917806e9 Updated all basic components
removed unnecessary components, combined where necessary
added each component to a folder, added individual css style modules
optimized some component rendering flows
removed functional components in favor of pure components
linted and formatted all of the files
2019-08-03 02:00:45 -04:00

27 lines
533 B
JavaScript

import { shortNumberFormat } from '../../utils/numbers';
import './index.scss';
const mapStateToProps = state => ({
count: state.getIn(['notifications', 'unread']),
});
class NotificationCounter extends PureComponent {
static propTypes = {
count: PropTypes.number.isRequired,
};
render() {
const { count } = this.props;
if (count < 1) return null;
return (
<span className='notification-counter'>{shortNumberFormat(count)}</span>
);
}
}
export default connect(mapStateToProps)(NotificationCounter);