From d206f183f5a07787535acd196c506145f00a199e Mon Sep 17 00:00:00 2001 From: Dan Date: Fri, 29 Sep 2017 16:33:29 -0230 Subject: Hide token confirmation modal ui --- ui/app/components/dropdowns/token-menu-dropdown.js | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'ui/app/components/dropdowns/token-menu-dropdown.js') diff --git a/ui/app/components/dropdowns/token-menu-dropdown.js b/ui/app/components/dropdowns/token-menu-dropdown.js index b948534c2..0f4bc2b87 100644 --- a/ui/app/components/dropdowns/token-menu-dropdown.js +++ b/ui/app/components/dropdowns/token-menu-dropdown.js @@ -1,8 +1,19 @@ const Component = require('react').Component const h = require('react-hyperscript') const inherits = require('util').inherits +const connect = require('react-redux').connect +const actions = require('../../actions') + +module.exports = connect(null, mapDispatchToProps)(TokenMenuDropdown) + +function mapDispatchToProps (dispatch) { + return { + showHideTokenConfirmationModal: (token) => { + dispatch(actions.showModal({ name: 'HIDE_TOKEN_CONFIRMATION', token })) + } + } +} -module.exports = TokenMenuDropdown inherits(TokenMenuDropdown, Component) function TokenMenuDropdown () { @@ -17,6 +28,8 @@ TokenMenuDropdown.prototype.onClose = function (e) { } TokenMenuDropdown.prototype.render = function () { + const { showHideTokenConfirmationModal } = this.props + return h('div.token-menu-dropdown', {}, [ h('div.token-menu-dropdown__close-area', { onClick: this.onClose, @@ -27,7 +40,7 @@ TokenMenuDropdown.prototype.render = function () { h('div.token-menu-dropdown__option', { onClick: (e) => { e.stopPropagation() - console.log('div.token-menu-dropdown__option!') + showHideTokenConfirmationModal(this.props.token) }, }, 'Hide Token') @@ -35,4 +48,3 @@ TokenMenuDropdown.prototype.render = function () { ]), ]) } - -- cgit v1.2.3