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
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
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);
|
||||
Reference in New Issue
Block a user