From 45c44989c8fb6e24badd18bb83ac5f68de0aceaf Mon Sep 17 00:00:00 2001 From: kibigo! Date: Fri, 17 Nov 2017 19:11:18 -0800 Subject: Forking glitch theme --- .../features/ui/containers/notifications_container.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 app/javascript/themes/glitch/features/ui/containers/notifications_container.js (limited to 'app/javascript/themes/glitch/features/ui/containers/notifications_container.js') diff --git a/app/javascript/themes/glitch/features/ui/containers/notifications_container.js b/app/javascript/themes/glitch/features/ui/containers/notifications_container.js new file mode 100644 index 000000000..5bd4017f5 --- /dev/null +++ b/app/javascript/themes/glitch/features/ui/containers/notifications_container.js @@ -0,0 +1,18 @@ +import { connect } from 'react-redux'; +import { NotificationStack } from 'react-notification'; +import { dismissAlert } from 'themes/glitch/actions/alerts'; +import { getAlerts } from 'themes/glitch/selectors'; + +const mapStateToProps = state => ({ + notifications: getAlerts(state), +}); + +const mapDispatchToProps = (dispatch) => { + return { + onDismiss: alert => { + dispatch(dismissAlert(alert)); + }, + }; +}; + +export default connect(mapStateToProps, mapDispatchToProps)(NotificationStack); -- cgit