diff options
author | frankiebee <frankie.diamond@gmail.com> | 2017-06-28 04:10:56 +0800 |
---|---|---|
committer | frankiebee <frankie.diamond@gmail.com> | 2017-06-28 04:10:56 +0800 |
commit | 847a4282a2c0db6561972147bd366622424f5d28 (patch) | |
tree | 2eefd2831cb627b9fd41e8858fe82714d85d399b /ui/app/account-detail.js | |
parent | abbbe1156c03700c4476d0618e65aa2eed2c264e (diff) | |
parent | 48f7cff8c0e765e85532c860c5f3061ca1d6deb7 (diff) | |
download | tangerine-wallet-browser-847a4282a2c0db6561972147bd366622424f5d28.tar tangerine-wallet-browser-847a4282a2c0db6561972147bd366622424f5d28.tar.gz tangerine-wallet-browser-847a4282a2c0db6561972147bd366622424f5d28.tar.bz2 tangerine-wallet-browser-847a4282a2c0db6561972147bd366622424f5d28.tar.lz tangerine-wallet-browser-847a4282a2c0db6561972147bd366622424f5d28.tar.xz tangerine-wallet-browser-847a4282a2c0db6561972147bd366622424f5d28.tar.zst tangerine-wallet-browser-847a4282a2c0db6561972147bd366622424f5d28.zip |
Merge branch 'master' into nonce-tracker
Diffstat (limited to 'ui/app/account-detail.js')
-rw-r--r-- | ui/app/account-detail.js | 40 |
1 files changed, 39 insertions, 1 deletions
diff --git a/ui/app/account-detail.js b/ui/app/account-detail.js index 7a78a360c..836032b3c 100644 --- a/ui/app/account-detail.js +++ b/ui/app/account-detail.js @@ -16,6 +16,9 @@ const ExportAccountView = require('./components/account-export') const ethUtil = require('ethereumjs-util') const EditableLabel = require('./components/editable-label') const Tooltip = require('./components/tooltip') +const TabBar = require('./components/tab-bar') +const TokenList = require('./components/token-list') + module.exports = connect(mapStateToProps)(AccountDetailScreen) function mapStateToProps (state) { @@ -31,6 +34,7 @@ function mapStateToProps (state) { transactions: state.metamask.selectedAddressTxList || [], conversionRate: state.metamask.conversionRate, currentCurrency: state.metamask.currentCurrency, + currentAccountTab: state.metamask.currentAccountTab, } } @@ -237,11 +241,44 @@ AccountDetailScreen.prototype.subview = function () { switch (subview) { case 'transactions': - return this.transactionList() + return this.tabSections() case 'export': var state = extend({key: 'export'}, this.props) return h(ExportAccountView, state) default: + return this.tabSections() + } +} + +AccountDetailScreen.prototype.tabSections = function () { + const { currentAccountTab } = this.props + + return h('section.tabSection', [ + + h(TabBar, { + tabs: [ + { content: 'Sent', key: 'history' }, + { content: 'Tokens', key: 'tokens' }, + ], + defaultTab: currentAccountTab || 'history', + tabSelected: (key) => { + this.props.dispatch(actions.setCurrentAccountTab(key)) + }, + }), + + this.tabSwitchView(), + ]) +} + +AccountDetailScreen.prototype.tabSwitchView = function () { + const props = this.props + const { address, network } = props + const { currentAccountTab } = this.props + + switch (currentAccountTab) { + case 'tokens': + return h(TokenList, { userAddress: address, network }) + default: return this.transactionList() } } @@ -249,6 +286,7 @@ AccountDetailScreen.prototype.subview = function () { AccountDetailScreen.prototype.transactionList = function () { const {transactions, unapprovedMsgs, address, network, shapeShiftTxList, conversionRate } = this.props + return h(TransactionList, { transactions: transactions.sort((a, b) => b.time - a.time), network, |