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.

21 lines
513 B

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