notifications_container.js 489 B

123456789101112131415161718
  1. import { connect } from 'react-redux';
  2. import { NotificationStack } from 'react-notification';
  3. import { dismissAlert } from '../../../actions/alerts';
  4. import { getAlerts } from '../../../selectors';
  5. const mapStateToProps = state => ({
  6. notifications: getAlerts(state),
  7. });
  8. const mapDispatchToProps = (dispatch) => {
  9. return {
  10. onDismiss: alert => {
  11. dispatch(dismissAlert(alert));
  12. },
  13. };
  14. };
  15. export default connect(mapStateToProps, mapDispatchToProps)(NotificationStack);