1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 01:39:44 +01:00

Add special rendering for contracts in transaction list

This commit is contained in:
Dan Finlay 2016-05-19 17:45:58 -07:00
parent 21dd806b27
commit d861c6ceca

View File

@ -100,36 +100,61 @@ module.exports = function(transactions, network) {
// large identicon // large identicon
h('.identicon-wrapper.flex-column.flex-center.select-none', [ h('.identicon-wrapper.flex-column.flex-center.select-none', [
h(Identicon, { identicon(txParams, transaction),
diameter: 24,
address: txParams.to,
}),
]), ]),
h('.flex-column', [ h('.flex-column', [
h('div', date), h('div', date),
h('div', { recipientField(txParams),
style: {
fontSize: 'small',
color: '#ABA9AA',
},
}, addressSummary(txParams.to)),
]), ]),
h(EtherBalance, { h(EtherBalance, {
value: txParams.value, value: txParams.value,
}), }),
]) ])
) )
} }
}
} function recipientField(txParams) {
if (txParams.to) {
return h('div', {
style: {
fontSize: 'small',
color: '#ABA9AA',
},
}, addressSummary(txParams.to))
} else {
return h('div', {
style: {
fontSize: 'small',
color: '#ABA9AA',
},
}, 'Contract Published')
}
}
function formatDate(date){ function formatDate(date){
return vreme.format(new Date(date), 'March 16 2014 14:30') return vreme.format(new Date(date), 'March 16 2014 14:30')
} }
function identicon(txParams, transaction) {
if (txParams.to) {
return h(Identicon, {
diameter: 24,
address: txParams.to || transaction.hash,
})
} else {
return h('i.fa.fa-file-text-o.fa-lg', {
style: {
width: '24px',
}
})
}
}