|
|
|
@ -2,9 +2,16 @@ const h = require('react-hyperscript') |
|
|
|
|
const formatBalance = require('../util').formatBalance |
|
|
|
|
const addressSummary = require('../util').addressSummary |
|
|
|
|
const explorerLink = require('../../lib/explorer-link') |
|
|
|
|
const Panel = require('./panel') |
|
|
|
|
|
|
|
|
|
module.exports = function(transactions, network) { |
|
|
|
|
return h('.tx-list', { |
|
|
|
|
return h('section', [ |
|
|
|
|
|
|
|
|
|
h('.current-domain-panel.flex-center.font-small', [ |
|
|
|
|
h('span', 'Transactions'), |
|
|
|
|
]), |
|
|
|
|
|
|
|
|
|
h('.tx-list', { |
|
|
|
|
style: { |
|
|
|
|
overflowY: 'auto', |
|
|
|
|
height: '180px', |
|
|
|
@ -13,21 +20,36 @@ module.exports = function(transactions, network) { |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
[ |
|
|
|
|
h('div.font-small', {style: {display: 'inline'}}, 'Transactions'), |
|
|
|
|
|
|
|
|
|
transactions.map((transaction) => { |
|
|
|
|
return h('.tx.flex-row.flex-space-around', { |
|
|
|
|
key: `listed-tx-${transaction.hash}`, |
|
|
|
|
}, [ |
|
|
|
|
h('a.font-small', |
|
|
|
|
console.dir(transaction) |
|
|
|
|
|
|
|
|
|
var panelOpts = { |
|
|
|
|
key: `tx-${transaction.hash}`, |
|
|
|
|
identiconKey: transaction.txParams.to, |
|
|
|
|
style: { |
|
|
|
|
cursor: 'pointer', |
|
|
|
|
}, |
|
|
|
|
onClick: (event) => { |
|
|
|
|
var url = explorerLink(transaction.hash, parseInt(network)) |
|
|
|
|
chrome.tabs.create({ url }); |
|
|
|
|
}, |
|
|
|
|
attributes: [ |
|
|
|
|
{ |
|
|
|
|
href: explorerLink(transaction.hash, parseInt(network)), |
|
|
|
|
target: '_blank', |
|
|
|
|
key: 'TO', |
|
|
|
|
value: addressSummary(transaction.txParams.to), |
|
|
|
|
}, |
|
|
|
|
addressSummary(transaction.txParams.to)), |
|
|
|
|
h('div.font-small', formatBalance(transaction.txParams.value)) |
|
|
|
|
]) |
|
|
|
|
{ |
|
|
|
|
key: 'VALUE', |
|
|
|
|
value: formatBalance(transaction.txParams.value), |
|
|
|
|
}, |
|
|
|
|
] |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return h(Panel, panelOpts) |
|
|
|
|
}) |
|
|
|
|
] |
|
|
|
|
) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
]) |
|
|
|
|
} |
|
|
|
|