mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Replace manual copy buttons with new CopyButton component
This commit is contained in:
parent
441a7eec28
commit
5c57169219
@ -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', {
|
||||
|
@ -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),
|
||||
}),
|
||||
]),
|
||||
])
|
||||
|
Loading…
Reference in New Issue
Block a user