1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-27 12:56:01 +01:00
metamask-extension/ui/app/components/transaction-list.js

40 lines
1021 B
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) {
2016-04-20 02:31:34 +02:00
return h('details', [
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))
])
})
)
])
}