aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/dropdowns
diff options
context:
space:
mode:
authorkumavis <kumavis@users.noreply.github.com>2018-06-19 06:11:16 +0800
committerGitHub <noreply@github.com>2018-06-19 06:11:16 +0800
commit4598554fea7b9435e5cbecc4735c479ffbadf37e (patch)
tree338aaee17d433383c9a57b385489cbc8df3f82d0 /ui/app/components/dropdowns
parent39a7702c8f0aa2c2e7fdf2bcf913e76bb8b827f4 (diff)
parent0e3ecbbc4f7ab0579a33bf315af4dfafeb43f339 (diff)
downloadtangerine-wallet-browser-4598554fea7b9435e5cbecc4735c479ffbadf37e.tar
tangerine-wallet-browser-4598554fea7b9435e5cbecc4735c479ffbadf37e.tar.gz
tangerine-wallet-browser-4598554fea7b9435e5cbecc4735c479ffbadf37e.tar.bz2
tangerine-wallet-browser-4598554fea7b9435e5cbecc4735c479ffbadf37e.tar.lz
tangerine-wallet-browser-4598554fea7b9435e5cbecc4735c479ffbadf37e.tar.xz
tangerine-wallet-browser-4598554fea7b9435e5cbecc4735c479ffbadf37e.tar.zst
tangerine-wallet-browser-4598554fea7b9435e5cbecc4735c479ffbadf37e.zip
Merge pull request #4603 from MetaMask/v4.8.0
V4.8.0
Diffstat (limited to 'ui/app/components/dropdowns')
-rw-r--r--ui/app/components/dropdowns/account-dropdown-mini.js2
-rw-r--r--ui/app/components/dropdowns/token-menu-dropdown.js53
2 files changed, 37 insertions, 18 deletions
diff --git a/ui/app/components/dropdowns/account-dropdown-mini.js b/ui/app/components/dropdowns/account-dropdown-mini.js
index a3d41af90..a7a908d3b 100644
--- a/ui/app/components/dropdowns/account-dropdown-mini.js
+++ b/ui/app/components/dropdowns/account-dropdown-mini.js
@@ -1,7 +1,7 @@
const Component = require('react').Component
const h = require('react-hyperscript')
const inherits = require('util').inherits
-const AccountListItem = require('../send/account-list-item')
+const AccountListItem = require('../send_/account-list-item/account-list-item.component').default
module.exports = AccountDropdownMini
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'),
+ }),
])
}