aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/transaction-list.js
blob: c5a86f0826766e738c0117e43563c40811288ed5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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('.tx-list', {
      style: {
        overflowY: 'auto',
        height: '180px',
        textAlign: 'center',
      },
    },

    [
      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',
          {
            href: explorerLink(transaction.hash, parseInt(network)),
            target: '_blank',
          },
          addressSummary(transaction.txParams.to)),
          h('div.font-small', formatBalance(transaction.txParams.value))
        ])
      })
    ]
  )
}