1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

Code cleanup

This commit is contained in:
Alexander Tseung 2018-07-31 19:56:51 -07:00
parent 5de48c67a0
commit fa8313f903
2 changed files with 14 additions and 30 deletions

View File

@ -12,7 +12,6 @@ import { hexToDecimal } from '../../helpers/conversions.util'
export default class TransactionListItem extends PureComponent { export default class TransactionListItem extends PureComponent {
static propTypes = { static propTypes = {
history: PropTypes.object, history: PropTypes.object,
methodData: PropTypes.object,
transaction: PropTypes.object, transaction: PropTypes.object,
ethTransactionAmount: PropTypes.string, ethTransactionAmount: PropTypes.string,
fiatDisplayValue: PropTypes.string, fiatDisplayValue: PropTypes.string,
@ -32,11 +31,7 @@ export default class TransactionListItem extends PureComponent {
} }
render () { render () {
const { const { transaction, ethTransactionAmount, fiatDisplayValue } = this.props
transaction,
ethTransactionAmount,
fiatDisplayValue,
} = this.props
const { txParams = {} } = transaction const { txParams = {} } = transaction
const nonce = hexToDecimal(txParams.nonce) const nonce = hexToDecimal(txParams.nonce)

View File

@ -30,14 +30,12 @@ export default class TransactionList extends PureComponent {
{ `${t('queue')} (${pendingTransactions.length})` } { `${t('queue')} (${pendingTransactions.length})` }
</div> </div>
{ {
pendingTransactions.map(transaction => { pendingTransactions.map(transaction => (
return ( <TransactionListItem
<TransactionListItem transaction={transaction}
transaction={transaction} key={transaction.id}
key={transaction.id} />
/> ))
)
})
} }
</div> </div>
) )
@ -48,16 +46,12 @@ export default class TransactionList extends PureComponent {
</div> </div>
{ {
completedTransactions.length > 0 completedTransactions.length > 0
? ( ? completedTransactions.map(transaction => (
completedTransactions.map(transaction => { <TransactionListItem
return ( transaction={transaction}
<TransactionListItem key={transaction.id}
transaction={transaction} />
key={transaction.id} ))
/>
)
})
)
: this.renderEmpty() : this.renderEmpty()
} }
</div> </div>
@ -78,12 +72,7 @@ export default class TransactionList extends PureComponent {
render () { render () {
return ( return (
<div className="transaction-list"> <div className="transaction-list">
{ { this.renderTransactions() }
this.renderTransactions()
// pendingTransactions.length + completedTransactions.length > 0
// ? this.renderTransactions()
// : this.renderEmpty()
}
</div> </div>
) )
} }