|
|
@ -40,26 +40,26 @@ TxList.prototype.render = function () { |
|
|
|
]), |
|
|
|
]), |
|
|
|
]), |
|
|
|
]), |
|
|
|
|
|
|
|
|
|
|
|
this.renderTranstions(), |
|
|
|
this.renderTransaction(), |
|
|
|
|
|
|
|
|
|
|
|
]) |
|
|
|
]) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
TxList.prototype.renderTranstions = function () { |
|
|
|
TxList.prototype.renderTransaction = function () { |
|
|
|
const { txsToRender } = this.props |
|
|
|
const { txsToRender, conversionRate } = this.props |
|
|
|
|
|
|
|
|
|
|
|
return txsToRender.length |
|
|
|
return txsToRender.length |
|
|
|
? txsToRender.map((transaction) => this.renderTransactionListItem(transaction)) |
|
|
|
? txsToRender.map((transaction) => this.renderTransactionListItem(transaction, conversionRate)) |
|
|
|
: [h('div.tx-list-item.tx-list-item--empty', [ 'No Transactions' ])] |
|
|
|
: [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, conversionRate) { |
|
|
|
const props = { |
|
|
|
const props = { |
|
|
|
dateString: formatDate(transaction.time), |
|
|
|
dateString: formatDate(transaction.time), |
|
|
|
address: transaction.txParams.to, |
|
|
|
address: transaction.txParams.to, |
|
|
|
transactionStatus: transaction.status, |
|
|
|
transactionStatus: transaction.status, |
|
|
|
transactionAmount: formatBalance(transaction.txParams.value, 6), |
|
|
|
transactionAmount: transaction.txParams.value, |
|
|
|
transActionId: transaction.id, |
|
|
|
transActionId: transaction.id, |
|
|
|
transactionHash: transaction.hash, |
|
|
|
transactionHash: transaction.hash, |
|
|
|
transactionNetworkId: transaction.metamaskNetworkId, |
|
|
|
transactionNetworkId: transaction.metamaskNetworkId, |
|
|
@ -85,6 +85,7 @@ TxList.prototype.renderTransactionListItem = function (transaction) { |
|
|
|
transactionAmount, |
|
|
|
transactionAmount, |
|
|
|
transactionHash, |
|
|
|
transactionHash, |
|
|
|
className: '.tx-list-item.tx-list-clickable', |
|
|
|
className: '.tx-list-item.tx-list-clickable', |
|
|
|
|
|
|
|
conversionRate, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (transactionStatus === 'unapproved') { |
|
|
|
if (transactionStatus === 'unapproved') { |
|
|
|