diff options
Diffstat (limited to 'ui/app')
-rw-r--r-- | ui/app/account-detail.js | 1 | ||||
-rw-r--r-- | ui/app/components/transaction-list.js | 34 |
2 files changed, 28 insertions, 7 deletions
diff --git a/ui/app/account-detail.js b/ui/app/account-detail.js index 836f4bcb9..e00a34c4a 100644 --- a/ui/app/account-detail.js +++ b/ui/app/account-detail.js @@ -244,6 +244,7 @@ AccountDetailScreen.prototype.transactionList = function () { network, unconfTxs, unconfMsgs, + address, shapeShiftTxList, viewPendingTx: (txId) => { this.props.dispatch(actions.viewPendingTx(txId)) diff --git a/ui/app/components/transaction-list.js b/ui/app/components/transaction-list.js index 9bf0f6d81..9348b9fc4 100644 --- a/ui/app/components/transaction-list.js +++ b/ui/app/components/transaction-list.js @@ -1,6 +1,8 @@ const Component = require('react').Component const h = require('react-hyperscript') const inherits = require('util').inherits +const genAccountLink = require('../../lib/account-link') +const extension = require('../../../app/scripts/lib/extension') const TransactionListItem = require('./transaction-list-item') @@ -13,13 +15,15 @@ function TransactionList () { } TransactionList.prototype.render = function () { - const { txsToRender, network, unconfMsgs } = this.props + const { txsToRender, network, unconfMsgs, address } = this.props + const transactions = txsToRender.concat(unconfMsgs) var shapeShiftTxList if (network === '1'){ shapeShiftTxList = this.props.shapeShiftTxList } const transactions = !shapeShiftTxList ? txsToRender.concat(unconfMsgs) : txsToRender.concat(unconfMsgs, shapeShiftTxList) .sort((a, b) => b.time - a.time) + const accountLink = genAccountLink(address, network) return ( @@ -49,11 +53,11 @@ TransactionList.prototype.render = function () { h('.tx-list', { style: { overflowY: 'auto', - height: '305px', + height: '300px', padding: '0 20px', textAlign: 'center', }, - }, ( + }, [ transactions.length ? transactions.map((transaction, i) => { @@ -63,13 +67,29 @@ TransactionList.prototype.render = function () { this.props.viewPendingTx(txId) }, }) - }) - : [h('.flex-center', { + }).concat(viewMoreButton(accountLink)) + : h('.flex-center', { style: { + flexDirection: 'column', height: '100%', }, - }, 'No transaction history...')] - )), + }, [ + 'No transaction history.', + viewMoreButton(accountLink), + ]), + ]), ]) ) } + +function viewMoreButton(url) { + return url ? h('button', { + style: { + margin: '10px', + }, + onClick: (ev) => { + ev.preventDefault() + extension.tabs.create({ url }) + }, + }, 'Show More') : null +} |