mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Add copy links to mini tx panels
This commit is contained in:
parent
9eea990425
commit
ec097c8e34
@ -9,6 +9,8 @@ const BN = ethUtil.BN
|
|||||||
const hexToBn = require('../../../app/scripts/lib/hex-to-bn')
|
const hexToBn = require('../../../app/scripts/lib/hex-to-bn')
|
||||||
|
|
||||||
const MiniAccountPanel = require('./mini-account-panel')
|
const MiniAccountPanel = require('./mini-account-panel')
|
||||||
|
const Tooltip = require('./tooltip')
|
||||||
|
const copyToClipboard = require('copy-to-clipboard')
|
||||||
const EthBalance = require('./eth-balance')
|
const EthBalance = require('./eth-balance')
|
||||||
const util = require('../util')
|
const util = require('../util')
|
||||||
const addressSummary = util.addressSummary
|
const addressSummary = util.addressSummary
|
||||||
@ -93,11 +95,23 @@ PendingTx.prototype.render = function () {
|
|||||||
fontFamily: 'Montserrat Bold, Montserrat, sans-serif',
|
fontFamily: 'Montserrat Bold, Montserrat, sans-serif',
|
||||||
},
|
},
|
||||||
}, identity.name),
|
}, identity.name),
|
||||||
h('span.font-small', {
|
|
||||||
style: {
|
h(Tooltip, {
|
||||||
fontFamily: 'Montserrat Light, Montserrat, sans-serif',
|
title: 'Copy address',
|
||||||
},
|
position: 'bottom',
|
||||||
}, addressSummary(address, 6, 4, false)),
|
}, [
|
||||||
|
h('span.font-small', {
|
||||||
|
onClick: (event) => {
|
||||||
|
event.preventDefault()
|
||||||
|
event.stopPropagation()
|
||||||
|
copyToClipboard(ethUtil.toChecksumAddress(address))
|
||||||
|
},
|
||||||
|
style: {
|
||||||
|
cursor: 'pointer',
|
||||||
|
fontFamily: 'Montserrat Light, Montserrat, sans-serif',
|
||||||
|
},
|
||||||
|
}, addressSummary(address, 6, 4, false)),
|
||||||
|
]),
|
||||||
|
|
||||||
h('span.font-small', {
|
h('span.font-small', {
|
||||||
style: {
|
style: {
|
||||||
@ -322,16 +336,30 @@ PendingTx.prototype.miniAccountPanelForRecipient = function () {
|
|||||||
imageSeed: txParams.to,
|
imageSeed: txParams.to,
|
||||||
picOrder: 'left',
|
picOrder: 'left',
|
||||||
}, [
|
}, [
|
||||||
|
|
||||||
h('span.font-small', {
|
h('span.font-small', {
|
||||||
style: {
|
style: {
|
||||||
fontFamily: 'Montserrat Bold, Montserrat, sans-serif',
|
fontFamily: 'Montserrat Bold, Montserrat, sans-serif',
|
||||||
},
|
},
|
||||||
}, nameForAddress(txParams.to, props.identities)),
|
}, nameForAddress(txParams.to, props.identities)),
|
||||||
h('span.font-small', {
|
|
||||||
style: {
|
h(Tooltip, {
|
||||||
fontFamily: 'Montserrat Light, Montserrat, sans-serif',
|
title: 'Copy address',
|
||||||
},
|
position: 'bottom',
|
||||||
}, addressSummary(txParams.to, 6, 4, false)),
|
}, [
|
||||||
|
h('span.font-small', {
|
||||||
|
onClick: (event) => {
|
||||||
|
event.preventDefault()
|
||||||
|
event.stopPropagation()
|
||||||
|
copyToClipboard(ethUtil.toChecksumAddress(txParams.to))
|
||||||
|
},
|
||||||
|
style: {
|
||||||
|
cursor: 'pointer',
|
||||||
|
fontFamily: 'Montserrat Light, Montserrat, sans-serif',
|
||||||
|
},
|
||||||
|
}, addressSummary(txParams.to, 6, 4, false)),
|
||||||
|
]),
|
||||||
|
|
||||||
])
|
])
|
||||||
} else {
|
} else {
|
||||||
return h(MiniAccountPanel, {
|
return h(MiniAccountPanel, {
|
||||||
|
Loading…
Reference in New Issue
Block a user