280dc51d85
reorganization, linting, updating file imports, consolidation warning: there will be errors in this commit todo: update webpack, add missing styles, scss files, consolidate the rest of components within features/*
26 lines
526 B
JavaScript
26 lines
526 B
JavaScript
import { shortNumberFormat } from '../../utils/numbers';
|
|
|
|
import './notification_counter.scss';
|
|
|
|
const mapStateToProps = state => ({
|
|
count: state.getIn(['notifications', 'unread']),
|
|
});
|
|
|
|
export default @connect(mapStateToProps)
|
|
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>
|
|
);
|
|
}
|
|
|
|
} |