mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Make mini account panel labels fully configurable
This commit is contained in:
parent
21f17214be
commit
1e92e7e9d4
@ -34,17 +34,7 @@ AccountPanel.prototype.render = function () {
|
|||||||
display: 'flex',
|
display: 'flex',
|
||||||
alignItems: picOrder === 'left' ? 'flex-begin' : 'flex-end',
|
alignItems: picOrder === 'left' ? 'flex-begin' : 'flex-end',
|
||||||
},
|
},
|
||||||
}, [
|
}, this.props.children),
|
||||||
|
|
||||||
attrs.map((attr) => {
|
|
||||||
return h('span.font-small', {
|
|
||||||
key: `mini-${attr}`,
|
|
||||||
style: {
|
|
||||||
fontFamily: 'Montserrat Light, Montserrat, sans-serif',
|
|
||||||
},
|
|
||||||
}, attr)
|
|
||||||
}),
|
|
||||||
]),
|
|
||||||
])
|
])
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -36,8 +36,6 @@ PTXP.render = function () {
|
|||||||
var maxCost = ((new BN(txValue, 16)).add(new BN(gasCost, 16))).toString(16)
|
var maxCost = ((new BN(txValue, 16)).add(new BN(gasCost, 16))).toString(16)
|
||||||
var dataLength = txParams.data ? (txParams.data.length - 2) / 2 : 0
|
var dataLength = txParams.data ? (txParams.data.length - 2) / 2 : 0
|
||||||
|
|
||||||
console.dir(identity)
|
|
||||||
console.dir({props})
|
|
||||||
return (
|
return (
|
||||||
h('div', [
|
h('div', [
|
||||||
|
|
||||||
@ -48,15 +46,28 @@ PTXP.render = function () {
|
|||||||
}, [
|
}, [
|
||||||
|
|
||||||
h(MiniAccountPanel, {
|
h(MiniAccountPanel, {
|
||||||
attrs: [
|
|
||||||
identity.name,
|
|
||||||
addressSummary(address, 6, 4, false),
|
|
||||||
formatBalance(balance),
|
|
||||||
],
|
|
||||||
imageSeed: address,
|
imageSeed: address,
|
||||||
imageifyIdenticons: props.imageifyIdenticons,
|
imageifyIdenticons: props.imageifyIdenticons,
|
||||||
picOrder: 'right',
|
picOrder: 'right',
|
||||||
}),
|
}, [
|
||||||
|
h('span.font-small', {
|
||||||
|
style: {
|
||||||
|
fontFamily: 'Montserrat Light, Montserrat, sans-serif',
|
||||||
|
},
|
||||||
|
}, identity.name),
|
||||||
|
h('span.font-small', {
|
||||||
|
style: {
|
||||||
|
fontFamily: 'Montserrat Light, Montserrat, sans-serif',
|
||||||
|
},
|
||||||
|
}, addressSummary(address, 6, 4, false)),
|
||||||
|
|
||||||
|
h('span.font-small', {
|
||||||
|
style: {
|
||||||
|
fontFamily: 'Montserrat Light, Montserrat, sans-serif',
|
||||||
|
},
|
||||||
|
}, formatBalance(balance)),
|
||||||
|
|
||||||
|
]),
|
||||||
|
|
||||||
h('img', {
|
h('img', {
|
||||||
src: 'images/forward-carrat.svg',
|
src: 'images/forward-carrat.svg',
|
||||||
@ -132,22 +143,35 @@ PTXP.miniAccountPanelForRecipient = function () {
|
|||||||
// If it's not a contract deploy, send to the account
|
// If it's not a contract deploy, send to the account
|
||||||
if (!isContractDeploy) {
|
if (!isContractDeploy) {
|
||||||
return h(MiniAccountPanel, {
|
return h(MiniAccountPanel, {
|
||||||
attrs: [
|
|
||||||
nameForAddress(txParams.to),
|
|
||||||
addressSummary(txParams.to, 6, 4, false),
|
|
||||||
],
|
|
||||||
imageSeed: txParams.to,
|
imageSeed: txParams.to,
|
||||||
imageifyIdenticons: props.imageifyIdenticons,
|
imageifyIdenticons: props.imageifyIdenticons,
|
||||||
picOrder: 'left',
|
picOrder: 'left',
|
||||||
})
|
}, [
|
||||||
|
h('span.font-small', {
|
||||||
|
style: {
|
||||||
|
fontFamily: 'Montserrat Light, Montserrat, sans-serif',
|
||||||
|
},
|
||||||
|
}, nameForAddress(txParams.to)),
|
||||||
|
h('span.font-small', {
|
||||||
|
style: {
|
||||||
|
fontFamily: 'Montserrat Light, Montserrat, sans-serif',
|
||||||
|
},
|
||||||
|
}, addressSummary(txParams.to, 6, 4, false)),
|
||||||
|
])
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
return h(MiniAccountPanel, {
|
return h(MiniAccountPanel, {
|
||||||
attrs: [
|
|
||||||
'New Contract',
|
|
||||||
],
|
|
||||||
imageifyIdenticons: props.imageifyIdenticons,
|
imageifyIdenticons: props.imageifyIdenticons,
|
||||||
picOrder: 'left',
|
picOrder: 'left',
|
||||||
})
|
}, [
|
||||||
|
|
||||||
|
h('span.font-small', {
|
||||||
|
style: {
|
||||||
|
fontFamily: 'Montserrat Light, Montserrat, sans-serif',
|
||||||
|
},
|
||||||
|
}, 'New Contract'),
|
||||||
|
|
||||||
|
])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user