aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/modals/notification/notification.container.js
diff options
context:
space:
mode:
authorPhyrexTsai <x01ep23i@hotmail.com>2018-06-01 15:41:18 +0800
committerGitHub <noreply@github.com>2018-06-01 15:41:18 +0800
commitf90d07019081695ef3d697c5af0ae2bee3bb1637 (patch)
treef7c68bb9bcaaddc035c6595bb78fcba98d6cfd1c /ui/app/components/modals/notification/notification.container.js
parentcc5bdadbf1f12f3f8d7f24f9bcf7ea81fe93f012 (diff)
parentcc73d869fed79c63261821fb7ad8f1e5180ffca2 (diff)
downloadtangerine-wallet-browser-f90d07019081695ef3d697c5af0ae2bee3bb1637.tar.gz
tangerine-wallet-browser-f90d07019081695ef3d697c5af0ae2bee3bb1637.tar.zst
tangerine-wallet-browser-f90d07019081695ef3d697c5af0ae2bee3bb1637.zip
Merge branch 'develop' into portal-metamask
Diffstat (limited to 'ui/app/components/modals/notification/notification.container.js')
-rw-r--r--ui/app/components/modals/notification/notification.container.js38
1 files changed, 38 insertions, 0 deletions
diff --git a/ui/app/components/modals/notification/notification.container.js b/ui/app/components/modals/notification/notification.container.js
new file mode 100644
index 000000000..5b98714da
--- /dev/null
+++ b/ui/app/components/modals/notification/notification.container.js
@@ -0,0 +1,38 @@
+import { connect } from 'react-redux'
+import Notification from './notification.component'
+
+const { hideModal } = require('../../../actions')
+
+const mapStateToProps = state => {
+ const { appState: { modal: { modalState: { props } } } } = state
+ const { onHide } = props
+ return {
+ onHide,
+ }
+}
+
+const mapDispatchToProps = dispatch => {
+ return {
+ hideModal: () => dispatch(hideModal()),
+ }
+}
+
+const mergeProps = (stateProps, dispatchProps, ownProps) => {
+ const { onHide, ...otherStateProps } = stateProps
+ const { hideModal, ...otherDispatchProps } = dispatchProps
+
+ return {
+ ...otherStateProps,
+ ...otherDispatchProps,
+ ...ownProps,
+ onHide: () => {
+ hideModal()
+
+ if (onHide && typeof onHide === 'function') {
+ onHide()
+ }
+ },
+ }
+}
+
+export default connect(mapStateToProps, mapDispatchToProps, mergeProps)(Notification)