about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/features/ui/components/notifications_counter_icon.js
blob: ef195013cc1e40e948b6e0e1b348295dd20dbd9a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
import { connect } from 'react-redux';
import IconWithBadge from 'flavours/glitch/components/icon_with_badge';

const mapStateToProps = state => ({
  count: state.getIn(['local_settings', 'notifications', 'tab_badge']) ? state.getIn(['notifications', 'unread']) : 0,
  issueBadge: state.getIn(['settings', 'notifications', 'alerts']).includes(true) && state.getIn(['notifications', 'browserSupport']) && state.getIn(['notifications', 'browserPermission']) !== 'granted',
  id: 'bell',
});

export default connect(mapStateToProps)(IconWithBadge);