aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2016-06-30 05:11:31 +0800
committerDan Finlay <dan@danfinlay.com>2016-06-30 05:11:31 +0800
commit5c57169219596e4637c59dd39c01812a4b1bb746 (patch)
tree8724d1491da42f0311a199647bb3680448261874 /ui
parent441a7eec2899c6553004ced2245d17ef9cc33a51 (diff)
downloadtangerine-wallet-browser-5c57169219596e4637c59dd39c01812a4b1bb746.tar
tangerine-wallet-browser-5c57169219596e4637c59dd39c01812a4b1bb746.tar.gz
tangerine-wallet-browser-5c57169219596e4637c59dd39c01812a4b1bb746.tar.bz2
tangerine-wallet-browser-5c57169219596e4637c59dd39c01812a4b1bb746.tar.lz
tangerine-wallet-browser-5c57169219596e4637c59dd39c01812a4b1bb746.tar.xz
tangerine-wallet-browser-5c57169219596e4637c59dd39c01812a4b1bb746.tar.zst
tangerine-wallet-browser-5c57169219596e4637c59dd39c01812a4b1bb746.zip
Replace manual copy buttons with new CopyButton component
Diffstat (limited to 'ui')
-rw-r--r--ui/app/account-detail.js11
-rw-r--r--ui/app/accounts/account-list-item.js12
2 files changed, 6 insertions, 17 deletions
diff --git a/ui/app/account-detail.js b/ui/app/account-detail.js
index 7daa3a4dd..8a17e095a 100644
--- a/ui/app/account-detail.js
+++ b/ui/app/account-detail.js
@@ -3,7 +3,7 @@ const extend = require('xtend')
const Component = require('react').Component
const h = require('react-hyperscript')
const connect = require('react-redux').connect
-const copyToClipboard = require('copy-to-clipboard')
+const CopyButton = require('./components/copyButton')
const actions = require('./actions')
const ReactCSSTransitionGroup = require('react-addons-css-transition-group')
const valuesFor = require('./util').valuesFor
@@ -105,13 +105,8 @@ AccountDetailScreen.prototype.render = function () {
},
}, ethUtil.toChecksumAddress(selected)),
- h('img.cursor-pointer.color-orange', {
- src: 'images/copy.svg',
- title: 'Copy Address',
- onClick: () => copyToClipboard(ethUtil.toChecksumAddress(selected)),
- style: {
- margin: '0px 5px',
- },
+ h(CopyButton, {
+ value: ethUtil.toChecksumAddress(selected),
}),
h('img.cursor-pointer.color-orange', {
diff --git a/ui/app/accounts/account-list-item.js b/ui/app/accounts/account-list-item.js
index 6bba6e145..1010516e2 100644
--- a/ui/app/accounts/account-list-item.js
+++ b/ui/app/accounts/account-list-item.js
@@ -4,7 +4,7 @@ const inherits = require('util').inherits
const ethUtil = require('ethereumjs-util')
const EtherBalance = require('../components/eth-balance')
-const copyToClipboard = require('copy-to-clipboard')
+const CopyButton = require('../components/copyButton')
const Identicon = require('../components/identicon')
module.exports = NewComponent
@@ -61,14 +61,8 @@ NewComponent.prototype.render = function () {
margin: '0 20px',
},
}, [
- h('img.cursor-pointer.color-orange', {
- title: 'Copy Address',
- src: 'images/copy.svg',
- onClick: (event) => {
- event.stopPropagation()
- event.preventDefault()
- copyToClipboard(ethUtil.toChecksumAddress(identity.address))
- },
+ h(CopyButton, {
+ value: ethUtil.toChecksumAddress(identity.address),
}),
]),
])