|
|
@ -20,14 +20,9 @@ function TxList () { |
|
|
|
Component.call(this) |
|
|
|
Component.call(this) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const contentDivider = h('div.tx-list-content-divider', { |
|
|
|
|
|
|
|
style: {}, |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TxList.prototype.render = function () { |
|
|
|
TxList.prototype.render = function () { |
|
|
|
|
|
|
|
|
|
|
|
const { txsToRender } = this.props |
|
|
|
// console.log('transactions to render', txsToRender)
|
|
|
|
console.log('transactions to render', txsToRender) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return h('div.flex-column.tx-list-container', {}, [ |
|
|
|
return h('div.flex-column.tx-list-container', {}, [ |
|
|
|
|
|
|
|
|
|
|
@ -46,15 +41,31 @@ TxList.prototype.render = function () { |
|
|
|
|
|
|
|
|
|
|
|
]), |
|
|
|
]), |
|
|
|
|
|
|
|
|
|
|
|
contentDivider, |
|
|
|
this.renderTranstions(), |
|
|
|
|
|
|
|
|
|
|
|
txsToRender.map((transaction) => { |
|
|
|
|
|
|
|
return this.renderTransactionListItem(transaction) |
|
|
|
|
|
|
|
}), |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
]) |
|
|
|
]) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TxList.prototype.getAddressText = function (transaction) { |
|
|
|
|
|
|
|
const { |
|
|
|
|
|
|
|
txParams: { to }, |
|
|
|
|
|
|
|
} = transaction |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return to |
|
|
|
|
|
|
|
? `${to.slice(0, 10)}...${to.slice(-4)}` |
|
|
|
|
|
|
|
: 'Contract Published' |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TxList.prototype.renderTranstions = function () { |
|
|
|
|
|
|
|
const { txsToRender } = this.props |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return txsToRender.length |
|
|
|
|
|
|
|
? txsToRender.map((transaction) => { |
|
|
|
|
|
|
|
return this.renderTransactionListItem(transaction) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
: h('div.tx-list-item.tx-list-item--empty', [ 'No Transactions' ]) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// TODO: Consider moving TxListItem into a separate component
|
|
|
|
// TODO: Consider moving TxListItem into a separate component
|
|
|
|
TxList.prototype.renderTransactionListItem = function (transaction) { |
|
|
|
TxList.prototype.renderTransactionListItem = function (transaction) { |
|
|
|
const props = { |
|
|
|
const props = { |
|
|
@ -70,12 +81,10 @@ TxList.prototype.renderTransactionListItem = function (transaction) { |
|
|
|
dateString, |
|
|
|
dateString, |
|
|
|
} = props |
|
|
|
} = props |
|
|
|
|
|
|
|
|
|
|
|
if (!address) return null |
|
|
|
return h('div.tx-list-item', { |
|
|
|
|
|
|
|
|
|
|
|
return h('div', { |
|
|
|
|
|
|
|
key: transaction.id, |
|
|
|
key: transaction.id, |
|
|
|
}, [ |
|
|
|
}, [ |
|
|
|
h('div.flex-column.tx-list-item-wrapper', { |
|
|
|
h('div.flex-column.tx-list-item__wrapper', { |
|
|
|
style: {}, |
|
|
|
style: {}, |
|
|
|
}, [ |
|
|
|
}, [ |
|
|
|
|
|
|
|
|
|
|
@ -105,7 +114,7 @@ TxList.prototype.renderTransactionListItem = function (transaction) { |
|
|
|
style: {}, |
|
|
|
style: {}, |
|
|
|
}, [ |
|
|
|
}, [ |
|
|
|
h('span.tx-list-account', {}, [ |
|
|
|
h('span.tx-list-account', {}, [ |
|
|
|
`${address.slice(0, 10)}...${address.slice(-4)}`, |
|
|
|
this.getAddressText(transaction), |
|
|
|
]), |
|
|
|
]), |
|
|
|
]), |
|
|
|
]), |
|
|
|
|
|
|
|
|
|
|
@ -134,7 +143,6 @@ TxList.prototype.renderTransactionListItem = function (transaction) { |
|
|
|
|
|
|
|
|
|
|
|
]), |
|
|
|
]), |
|
|
|
]), |
|
|
|
]), |
|
|
|
contentDivider, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
]) |
|
|
|
]) |
|
|
|
} |
|
|
|
} |
|
|
|