2016-04-20 00:07:15 +02:00
|
|
|
const h = require('react-hyperscript')
|
2016-04-20 02:31:34 +02:00
|
|
|
const formatBalance = require('../util').formatBalance
|
2016-04-20 03:21:28 +02:00
|
|
|
const addressSummary = require('../util').addressSummary
|
|
|
|
const explorerLink = require('../../lib/explorer-link')
|
2016-04-20 00:07:15 +02:00
|
|
|
|
2016-04-20 03:21:28 +02:00
|
|
|
module.exports = function(transactions, network) {
|
2016-05-05 03:08:31 +02:00
|
|
|
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', [
|
2016-04-20 03:21:28 +02:00
|
|
|
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 00:07:15 +02:00
|
|
|
},
|
2016-04-20 02:31:34 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
transactions.map((transaction) => {
|
|
|
|
return h('.tx.flex-row.flex-space-around', [
|
|
|
|
h('a.font-small',
|
|
|
|
{
|
2016-04-20 03:21:28 +02:00
|
|
|
href: explorerLink(transaction.hash, parseInt(network)),
|
2016-04-20 02:31:34 +02:00
|
|
|
target: '_blank',
|
|
|
|
},
|
2016-04-20 03:21:28 +02:00
|
|
|
addressSummary(transaction.txParams.to)),
|
2016-04-20 02:31:34 +02:00
|
|
|
h('div.font-small', formatBalance(transaction.txParams.value))
|
|
|
|
])
|
|
|
|
})
|
|
|
|
)
|
|
|
|
|
|
|
|
])
|
2016-04-20 00:07:15 +02:00
|
|
|
}
|