diff options
author | Csaba S <csaba.solya@gmail.com> | 2018-06-19 01:29:09 +0800 |
---|---|---|
committer | Alexander Tseung <alextsg@users.noreply.github.com> | 2018-06-19 01:29:09 +0800 |
commit | 8aab4dd1fa5db1de54af7a029f0a758154572b49 (patch) | |
tree | 7d5f8d0416197cb1afe461a2974705322a035968 /ui/app | |
parent | 01c9d81c9feda0f80d3c2006fac208a00c1a64cb (diff) | |
download | tangerine-wallet-browser-8aab4dd1fa5db1de54af7a029f0a758154572b49.tar tangerine-wallet-browser-8aab4dd1fa5db1de54af7a029f0a758154572b49.tar.gz tangerine-wallet-browser-8aab4dd1fa5db1de54af7a029f0a758154572b49.tar.bz2 tangerine-wallet-browser-8aab4dd1fa5db1de54af7a029f0a758154572b49.tar.lz tangerine-wallet-browser-8aab4dd1fa5db1de54af7a029f0a758154572b49.tar.xz tangerine-wallet-browser-8aab4dd1fa5db1de54af7a029f0a758154572b49.tar.zst tangerine-wallet-browser-8aab4dd1fa5db1de54af7a029f0a758154572b49.zip |
View address of an added token (#4591)
* adding menu actions for tokens
* apply common style
Diffstat (limited to 'ui/app')
-rw-r--r-- | ui/app/components/dropdowns/token-menu-dropdown.js | 53 | ||||
-rw-r--r-- | ui/app/css/itcss/components/token-list.scss | 6 |
2 files changed, 37 insertions, 22 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'), + }), ]) } diff --git a/ui/app/css/itcss/components/token-list.scss b/ui/app/css/itcss/components/token-list.scss index 72fda372f..4b706abce 100644 --- a/ui/app/css/itcss/components/token-list.scss +++ b/ui/app/css/itcss/components/token-list.scss @@ -81,13 +81,9 @@ $wallet-balance-breakpoint-range: "screen and (min-width: #{$break-large}) and ( } .token-menu-dropdown { - height: 55px; width: 80%; - border-radius: 4px; - background-color: rgba(0, 0, 0, .82); - box-shadow: 0 2px 4px 0 rgba(0, 0, 0, .5); position: absolute; - top: 60px; + top: 52px; right: 25px; z-index: 2000; |