diff options
author | kumavis <kumavis@users.noreply.github.com> | 2018-06-02 07:03:56 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-02 07:03:56 +0800 |
commit | 4be8e780cd64014d07c036c29faa77f947437c4a (patch) | |
tree | 37c76b1bbad225adc70f45a8fd17e8718e2b6453 /ui/app/components/modals/notification/notification.container.js | |
parent | dc5477be3cc62dff912a9447c702edab66200f02 (diff) | |
parent | b1b90a6bb979cbda8b865e680dba621201d9f801 (diff) | |
download | tangerine-wallet-browser-4be8e780cd64014d07c036c29faa77f947437c4a.tar.gz tangerine-wallet-browser-4be8e780cd64014d07c036c29faa77f947437c4a.tar.zst tangerine-wallet-browser-4be8e780cd64014d07c036c29faa77f947437c4a.zip |
Merge pull request #4449 from MetaMask/Version-4.7.1
Version 4.7.1
Diffstat (limited to 'ui/app/components/modals/notification/notification.container.js')
-rw-r--r-- | ui/app/components/modals/notification/notification.container.js | 38 |
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) |