diff options
author | brunobar79 <brunobar79@gmail.com> | 2018-07-02 05:41:34 +0800 |
---|---|---|
committer | brunobar79 <brunobar79@gmail.com> | 2018-07-02 05:41:34 +0800 |
commit | 1494cc5e6c5943095c89e3b243b0a6152876e72c (patch) | |
tree | e34e74e79e8d41ce5903cc8d6eedf5caa19bc354 /ui/app/components/dropdowns | |
parent | 6e563acd93cbaf20fb233a267104fc6af3384287 (diff) | |
parent | b2e64f24ecbc9e309869e678254cf755ffe11b40 (diff) | |
download | tangerine-wallet-browser-1494cc5e6c5943095c89e3b243b0a6152876e72c.tar tangerine-wallet-browser-1494cc5e6c5943095c89e3b243b0a6152876e72c.tar.gz tangerine-wallet-browser-1494cc5e6c5943095c89e3b243b0a6152876e72c.tar.bz2 tangerine-wallet-browser-1494cc5e6c5943095c89e3b243b0a6152876e72c.tar.lz tangerine-wallet-browser-1494cc5e6c5943095c89e3b243b0a6152876e72c.tar.xz tangerine-wallet-browser-1494cc5e6c5943095c89e3b243b0a6152876e72c.tar.zst tangerine-wallet-browser-1494cc5e6c5943095c89e3b243b0a6152876e72c.zip |
fix merge conflicts
Diffstat (limited to 'ui/app/components/dropdowns')
-rw-r--r-- | ui/app/components/dropdowns/token-menu-dropdown.js | 53 |
1 files changed, 36 insertions, 17 deletions
diff --git a/ui/app/components/dropdowns/token-menu-dropdown.js b/ui/app/components/dropdowns/token-menu-dropdown.js index b70d0b893..fac7c451b 100644 --- a/ui/app/components/dropdowns/token-menu-dropdown.js +++ b/ui/app/components/dropdowns/token-menu-dropdown.js @@ -4,14 +4,21 @@ const h = require('react-hyperscript') const inherits = require('util').inherits const connect = require('react-redux').connect const actions = require('../../actions') - +const genAccountLink = require('etherscan-link').createAccountLink +const copyToClipboard = require('copy-to-clipboard') +const { Menu, Item, CloseArea } = require('./components/menu') TokenMenuDropdown.contextTypes = { t: PropTypes.func, } -module.exports = connect(null, mapDispatchToProps)(TokenMenuDropdown) +module.exports = connect(mapStateToProps, mapDispatchToProps)(TokenMenuDropdown) +function mapStateToProps (state) { + return { + network: state.metamask.network, + } +} function mapDispatchToProps (dispatch) { return { @@ -37,22 +44,34 @@ 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', { + return h(Menu, { className: 'token-menu-dropdown', isShowing: true }, [ + h(CloseArea, { 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() - }, - }, this.context.t('hideToken')), - - ]), - ]), + h(Item, { + onClick: (e) => { + e.stopPropagation() + showHideTokenConfirmationModal(this.props.token) + this.props.onClose() + }, + text: this.context.t('hideToken'), + }), + h(Item, { + onClick: (e) => { + e.stopPropagation() + copyToClipboard(this.props.token.address) + this.props.onClose() + }, + text: this.context.t('copyContractAddress'), + }), + h(Item, { + onClick: (e) => { + e.stopPropagation() + const url = genAccountLink(this.props.token.address, this.props.network) + global.platform.openWindow({ url }) + this.props.onClose() + }, + text: this.context.t('viewOnEtherscan'), + }), ]) } |