mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
40 lines
1021 B
JavaScript
40 lines
1021 B
JavaScript
const h = require('react-hyperscript')
|
|
const formatBalance = require('../util').formatBalance
|
|
const addressSummary = require('../util').addressSummary
|
|
const explorerLink = require('../../lib/explorer-link')
|
|
|
|
module.exports = function(transactions, network) {
|
|
return h('details', [
|
|
|
|
h('summary', [
|
|
h('div.font-small', {style: {display: 'inline'}}, 'Transactions'),
|
|
]),
|
|
|
|
h('.flex-row.flex-space-around', [
|
|
h('div.font-small','To'),
|
|
h('div.font-small','Amount'),
|
|
]),
|
|
|
|
h('.tx-list', {
|
|
style: {
|
|
overflowY: 'auto',
|
|
height: '180px',
|
|
},
|
|
},
|
|
|
|
transactions.map((transaction) => {
|
|
return h('.tx.flex-row.flex-space-around', [
|
|
h('a.font-small',
|
|
{
|
|
href: explorerLink(transaction.hash, parseInt(network)),
|
|
target: '_blank',
|
|
},
|
|
addressSummary(transaction.txParams.to)),
|
|
h('div.font-small', formatBalance(transaction.txParams.value))
|
|
])
|
|
})
|
|
)
|
|
|
|
])
|
|
}
|