diff options
author | kumavis <kumavis@users.noreply.github.com> | 2018-02-28 03:25:29 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-28 03:25:29 +0800 |
commit | 3fefccd37219c9b4b513fc8d929723e07022b9c4 (patch) | |
tree | 22865ecd672570a6162ac3c9402ec9d63ad3f7ef /ui/app/components/dropdowns/token-menu-dropdown.js | |
parent | 6a7ea00cd34f83b257f6b4280a5f4e20aa5d34ee (diff) | |
parent | ced62ac551a095c8f94f550f0c01a9d4fd04ce5b (diff) | |
download | tangerine-wallet-browser-3fefccd37219c9b4b513fc8d929723e07022b9c4.tar.gz tangerine-wallet-browser-3fefccd37219c9b4b513fc8d929723e07022b9c4.tar.zst tangerine-wallet-browser-3fefccd37219c9b4b513fc8d929723e07022b9c4.zip |
Merge branch 'master' into mascara-deploy
Diffstat (limited to 'ui/app/components/dropdowns/token-menu-dropdown.js')
-rw-r--r-- | ui/app/components/dropdowns/token-menu-dropdown.js | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/ui/app/components/dropdowns/token-menu-dropdown.js b/ui/app/components/dropdowns/token-menu-dropdown.js new file mode 100644 index 000000000..dc7a985e3 --- /dev/null +++ b/ui/app/components/dropdowns/token-menu-dropdown.js @@ -0,0 +1,51 @@ +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 })) + }, + } +} + + +inherits(TokenMenuDropdown, Component) +function TokenMenuDropdown () { + Component.call(this) + + this.onClose = this.onClose.bind(this) +} + +TokenMenuDropdown.prototype.onClose = function (e) { + e.stopPropagation() + this.props.onClose() +} + +TokenMenuDropdown.prototype.render = function () { + const { showHideTokenConfirmationModal } = this.props + + return h('div.token-menu-dropdown', {}, [ + h('div.token-menu-dropdown__close-area', { + onClick: this.onClose, + }), + h('div.token-menu-dropdown__container', {}, [ + h('div.token-menu-dropdown__options', {}, [ + + h('div.token-menu-dropdown__option', { + onClick: (e) => { + e.stopPropagation() + showHideTokenConfirmationModal(this.props.token) + this.props.onClose() + }, + }, 'Hide Token'), + + ]), + ]), + ]) +} |