diff options
Diffstat (limited to 'ui/app/components/transaction-list-item.js')
-rw-r--r-- | ui/app/components/transaction-list-item.js | 30 |
1 files changed, 11 insertions, 19 deletions
diff --git a/ui/app/components/transaction-list-item.js b/ui/app/components/transaction-list-item.js index fc1c3c630..56f2103f3 100644 --- a/ui/app/components/transaction-list-item.js +++ b/ui/app/components/transaction-list-item.js @@ -5,20 +5,18 @@ const inherits = require('util').inherits const EtherBalance = require('./eth-balance') const addressSummary = require('../util').addressSummary const explorerLink = require('../../lib/explorer-link') -const formatBalance = require('../util').formatBalance const vreme = new (require('vreme')) const TransactionIcon = require('./transaction-list-item-icon') module.exports = TransactionListItem - inherits(TransactionListItem, Component) -function TransactionListItem() { +function TransactionListItem () { Component.call(this) } -TransactionListItem.prototype.render = function() { +TransactionListItem.prototype.render = function () { const { transaction, i, network } = this.props var date = formatDate(transaction.time) @@ -59,8 +57,8 @@ TransactionListItem.prototype.render = function() { // large identicon h('.identicon-wrapper.flex-column.flex-center.select-none', [ - transaction.status === 'unconfirmed' ? h('.red-dot', ' ') : - h(TransactionIcon, { txParams, transaction, isTx, isMsg }), + transaction.status === 'unconfirmed' ? h('.red-dot', ' ') + : h(TransactionIcon, { txParams, transaction, isTx, isMsg }), ]), h('.flex-column', [ @@ -76,24 +74,24 @@ TransactionListItem.prototype.render = function() { ) } -function domainField(txParams) { +function domainField (txParams) { return h('div', { style: { fontSize: 'small', color: '#ABA9AA', }, - },[ + }, [ txParams.origin, ]) } -function recipientField(txParams, transaction, isTx, isMsg) { +function recipientField (txParams, transaction, isTx, isMsg) { let message if (isMsg) { message = 'Signature Requested' } else if (txParams.to) { - message = addressSummary(txParams.to) + message = addressSummary(txParams.to) } else { message = 'Contract Published' } @@ -103,23 +101,17 @@ function recipientField(txParams, transaction, isTx, isMsg) { fontSize: 'small', color: '#ABA9AA', }, - },[ + }, [ message, failIfFailed(transaction), ]) - -} - -TransactionListItem.prototype.renderMessage = function() { - const { transaction, i, network } = this.props - return h('div', 'wowie, thats a message') } -function formatDate(date){ +function formatDate (date) { return vreme.format(new Date(date), 'March 16 2014 14:30') } -function failIfFailed(transaction) { +function failIfFailed (transaction) { if (transaction.status === 'rejected') { return h('span.error', ' (Rejected)') } |