1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-24 02:58:09 +01:00
metamask-extension/ui/app/components/transaction-list.js

40 lines
1.0 KiB
JavaScript
Raw Normal View History

const h = require('react-hyperscript')
2016-04-20 02:31:34 +02:00
const formatBalance = require('../util').formatBalance
const addressSummary = require('../util').addressSummary
const explorerLink = require('../../lib/explorer-link')
module.exports = function(transactions, network) {
return h('details', { key: 'transaction-list' }, [
2016-04-20 02:31:34 +02:00
h('summary', [
2016-04-20 04:10:22 +02:00
h('div.font-small', {style: {display: 'inline'}}, 'Transactions'),
2016-04-20 02:31:34 +02:00
]),
h('.flex-row.flex-space-around', [
h('div.font-small','To'),
2016-04-20 02:31:34 +02:00
h('div.font-small','Amount'),
]),
h('.tx-list', {
style: {
overflowY: 'auto',
height: '180px',
},
2016-04-20 02:31:34 +02:00
},
transactions.map((transaction) => {
return h('.tx.flex-row.flex-space-around', [
h('a.font-small',
{
href: explorerLink(transaction.hash, parseInt(network)),
2016-04-20 02:31:34 +02:00
target: '_blank',
},
addressSummary(transaction.txParams.to)),
2016-04-20 02:31:34 +02:00
h('div.font-small', formatBalance(transaction.txParams.value))
])
})
)
])
}