You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
1.0 KiB

  1. /*
  2. `<NotificationOverlayContainer>`
  3. =========================
  4. This container connects `<NotificationOverlay>`s to the Redux store.
  5. */
  6. // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  7. /*
  8. Imports:
  9. --------
  10. */
  11. // Package imports //
  12. import { connect } from 'react-redux';
  13. // Our imports //
  14. import NotificationOverlay from './notification_overlay';
  15. import { markNotificationForDelete } from '../../../../mastodon/actions/notifications';
  16. // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  17. /*
  18. Dispatch mapping:
  19. -----------------
  20. The `mapDispatchToProps()` function maps dispatches to our store to the
  21. various props of our component. We only need to provide a dispatch for
  22. deleting notifications.
  23. */
  24. const mapDispatchToProps = dispatch => ({
  25. onMarkForDelete(id, yes) {
  26. dispatch(markNotificationForDelete(id, yes));
  27. },
  28. });
  29. const mapStateToProps = state => ({
  30. revealed: state.getIn(['notifications', 'cleaningMode']),
  31. });
  32. export default connect(mapStateToProps, mapDispatchToProps)(NotificationOverlay);