The code powering m.abunchtell.com https://m.abunchtell.com
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.
 
 
 
 

26 lines
704 B

  1. import { connect } from 'react-redux';
  2. import { NotificationStack } from 'react-notification';
  3. import {
  4. dismissNotification,
  5. clearNotifications
  6. } from '../../../actions/notifications';
  7. const mapStateToProps = (state, props) => ({
  8. notifications: state.get('notifications').map((item, i) => ({
  9. message: item.get('message'),
  10. title: item.get('title'),
  11. key: item.get('key'),
  12. dismissAfter: 5000
  13. })).toJS()
  14. });
  15. const mapDispatchToProps = (dispatch) => {
  16. return {
  17. onDismiss: notifiction => {
  18. dispatch(dismissNotification(notifiction));
  19. }
  20. };
  21. };
  22. export default connect(mapStateToProps, mapDispatchToProps)(NotificationStack);