diff options
author | Frankie <frankie.diamond@gmail.com> | 2017-01-14 02:44:22 +0800 |
---|---|---|
committer | Frankie <frankie.diamond@gmail.com> | 2017-01-14 02:44:22 +0800 |
commit | 5ed52eed680f503adb0e510320b2610658157d4d (patch) | |
tree | 1ce43128e96bdbcb405215c809f6c51675ff021e /ui/app | |
parent | 34081c8cb2635bba0d6dd8a93d381f6554faa861 (diff) | |
download | tangerine-wallet-browser-5ed52eed680f503adb0e510320b2610658157d4d.tar tangerine-wallet-browser-5ed52eed680f503adb0e510320b2610658157d4d.tar.gz tangerine-wallet-browser-5ed52eed680f503adb0e510320b2610658157d4d.tar.bz2 tangerine-wallet-browser-5ed52eed680f503adb0e510320b2610658157d4d.tar.lz tangerine-wallet-browser-5ed52eed680f503adb0e510320b2610658157d4d.tar.xz tangerine-wallet-browser-5ed52eed680f503adb0e510320b2610658157d4d.tar.zst tangerine-wallet-browser-5ed52eed680f503adb0e510320b2610658157d4d.zip |
Clean up code
Diffstat (limited to 'ui/app')
-rw-r--r-- | ui/app/account-detail.js | 5 | ||||
-rw-r--r-- | ui/app/components/transaction-list-item-icon.js | 61 | ||||
-rw-r--r-- | ui/app/components/transaction-list.js | 4 |
3 files changed, 37 insertions, 33 deletions
diff --git a/ui/app/account-detail.js b/ui/app/account-detail.js index 76554472e..d7473aee5 100644 --- a/ui/app/account-detail.js +++ b/ui/app/account-detail.js @@ -29,7 +29,7 @@ function mapStateToProps (state) { network: state.metamask.network, unconfMsgs: valuesFor(state.metamask.unconfMsgs), shapeShiftTxList: state.metamask.shapeShiftTxList, - transactions: state.metamask.transactions, + transactions: state.metamask.selectedAccountTxList || [], } } @@ -249,9 +249,8 @@ AccountDetailScreen.prototype.subview = function () { AccountDetailScreen.prototype.transactionList = function () { const {transactions, unconfMsgs, address, network, shapeShiftTxList } = this.props // sort by recency - var soretedTxs = transactions.sort((a, b) => b.time - a.time) return h(TransactionList, { - transactions: soretedTxs, + transactions: transactions.sort((a, b) => b.time - a.time), network, unconfMsgs, address, diff --git a/ui/app/components/transaction-list-item-icon.js b/ui/app/components/transaction-list-item-icon.js index 356b77c3b..eca0d693a 100644 --- a/ui/app/components/transaction-list-item-icon.js +++ b/ui/app/components/transaction-list-item-icon.js @@ -13,36 +13,41 @@ function TransactionIcon () { TransactionIcon.prototype.render = function () { const { transaction, txParams, isMsg } = this.props - if (transaction.status === 'unapproved') { - return h('.unapproved-tx', { - style: { - width: '15px', - height: '15px', - background: '#00bfff', - borderRadius: '13px', - }, - }) + switch (transaction.status) { + case 'unapproved': + return h('.unapproved-tx', { + style: { + width: '24px', + height: '24px', + background: '#4dffff', + border: 'solid', + borderColor: '#AEAEAE', + borderWidth: '0.5px', + borderRadius: '13px', + }, + }) - } else if (transaction.status === 'rejected') { - return h('i.fa.fa-exclamation-triangle.fa-lg.warning', { - style: { - width: '24px', - }, - }) - } else if (transaction.status === 'signed') { - return h('i.fa.fa-ellipsis-h', { - style: { - fontSize: '27px', - }, - }) - } else if (transaction.status === 'failed') { - return h('i.fa.fa-exclamation-triangle.fa-lg.warning', { - style: { - fontSize: '24px', - }, - }) - } + case 'rejected': + return h('i.fa.fa-exclamation-triangle.fa-lg.warning', { + style: { + width: '24px', + }, + }) + case 'failed': + return h('i.fa.fa-exclamation-triangle.fa-lg.error', { + style: { + width: '24px', + }, + }) + + case 'signed': + return h('i.fa.fa-ellipsis-h', { + style: { + fontSize: '27px', + }, + }) + } if (isMsg) { return h('i.fa.fa-certificate.fa-lg', { diff --git a/ui/app/components/transaction-list.js b/ui/app/components/transaction-list.js index 105b34c90..b055ca9d5 100644 --- a/ui/app/components/transaction-list.js +++ b/ui/app/components/transaction-list.js @@ -13,13 +13,13 @@ function TransactionList () { } TransactionList.prototype.render = function () { - const { transactions = [], network, unconfMsgs } = this.props + const { transactions, network, unconfMsgs } = this.props var shapeShiftTxList if (network === '1') { shapeShiftTxList = this.props.shapeShiftTxList } - const txsToRender = !shapeShiftTxList ? transactions.concat(unconfMsgs) : txsToRender.concat(unconfMsgs, shapeShiftTxList) + const txsToRender = !shapeShiftTxList ? transactions.concat(unconfMsgs) : transactions.concat(unconfMsgs, shapeShiftTxList) .sort((a, b) => b.time - a.time) return ( |