2016-05-26 02:18:04 +02:00
|
|
|
const Component = require('react').Component
|
2016-04-20 00:07:15 +02:00
|
|
|
const h = require('react-hyperscript')
|
2016-05-26 02:18:04 +02:00
|
|
|
const inherits = require('util').inherits
|
|
|
|
|
2016-05-26 02:57:08 +02:00
|
|
|
const TransactionListItem = require('./transaction-list-item')
|
2016-05-19 02:48:50 +02:00
|
|
|
|
2016-05-26 02:18:04 +02:00
|
|
|
module.exports = TransactionList
|
|
|
|
|
|
|
|
|
|
|
|
inherits(TransactionList, Component)
|
2016-06-21 22:18:32 +02:00
|
|
|
function TransactionList () {
|
2016-05-26 02:18:04 +02:00
|
|
|
Component.call(this)
|
|
|
|
}
|
|
|
|
|
2016-06-21 22:18:32 +02:00
|
|
|
TransactionList.prototype.render = function () {
|
2016-06-21 22:56:04 +02:00
|
|
|
const { txsToRender, network, unconfMsgs } = this.props
|
2016-05-26 23:12:41 +02:00
|
|
|
const transactions = txsToRender.concat(unconfMsgs)
|
|
|
|
.sort((a, b) => b.time - a.time)
|
2016-04-20 00:07:15 +02:00
|
|
|
|
2016-05-14 01:28:46 +02:00
|
|
|
return (
|
2016-05-06 23:42:08 +02:00
|
|
|
|
2016-05-14 01:28:46 +02:00
|
|
|
h('section.transaction-list', [
|
2016-05-06 23:42:08 +02:00
|
|
|
|
2016-05-19 02:48:50 +02:00
|
|
|
h('style', `
|
|
|
|
.transaction-list .transaction-list-item:not(:last-of-type) {
|
|
|
|
border-bottom: 1px solid #D4D4D4;
|
|
|
|
}
|
|
|
|
.transaction-list .transaction-list-item .ether-balance-label {
|
|
|
|
display: block !important;
|
|
|
|
font-size: small;
|
|
|
|
}
|
|
|
|
`),
|
|
|
|
|
2016-05-14 01:28:46 +02:00
|
|
|
h('h3.flex-center.text-transform-uppercase', {
|
|
|
|
style: {
|
|
|
|
background: '#EBEBEB',
|
2016-05-14 02:02:33 +02:00
|
|
|
color: '#AEAEAE',
|
2016-06-30 21:43:28 +02:00
|
|
|
paddingTop: '4px',
|
|
|
|
paddingBottom: '4px',
|
2016-05-14 01:28:46 +02:00
|
|
|
},
|
|
|
|
}, [
|
|
|
|
'Transactions',
|
|
|
|
]),
|
|
|
|
|
|
|
|
h('.tx-list', {
|
2016-05-06 23:42:08 +02:00
|
|
|
style: {
|
|
|
|
overflowY: 'auto',
|
2016-06-30 21:43:28 +02:00
|
|
|
height: '305px',
|
2016-05-14 01:36:04 +02:00
|
|
|
padding: '0 20px',
|
2016-05-06 23:42:08 +02:00
|
|
|
textAlign: 'center',
|
|
|
|
},
|
2016-05-14 01:28:46 +02:00
|
|
|
}, (
|
2016-05-06 23:42:08 +02:00
|
|
|
|
2016-06-21 22:56:04 +02:00
|
|
|
transactions.length
|
|
|
|
? transactions.map((transaction, i) => {
|
2016-05-26 02:57:08 +02:00
|
|
|
return h(TransactionListItem, {
|
2016-05-26 23:41:11 +02:00
|
|
|
transaction, i, network,
|
2016-06-21 22:18:32 +02:00
|
|
|
showTx: (txId) => {
|
2016-05-26 23:32:45 +02:00
|
|
|
this.props.viewPendingTx(txId)
|
|
|
|
},
|
2016-05-26 02:57:08 +02:00
|
|
|
})
|
|
|
|
})
|
2016-06-21 22:56:04 +02:00
|
|
|
: [h('.flex-center', {
|
|
|
|
style: {
|
|
|
|
height: '100%',
|
|
|
|
},
|
|
|
|
}, 'No transaction history...')]
|
2016-06-21 22:18:32 +02:00
|
|
|
)),
|
2016-05-14 01:28:46 +02:00
|
|
|
])
|
|
|
|
)
|
2016-05-26 02:18:04 +02:00
|
|
|
}
|