diff options
author | Alexander Tseung <alextsg@gmail.com> | 2017-11-29 12:24:35 +0800 |
---|---|---|
committer | Alexander Tseung <alextsg@gmail.com> | 2017-12-15 04:50:20 +0800 |
commit | e226b10a89d87af07c7c35ff1251a8264f3bb1b8 (patch) | |
tree | 2a1507463ac1074a39e4ebd3ae609be0a2962bc6 /ui/app/components/wallet-view.js | |
parent | 339eb7d1a687f141e822c745c568063783d44f15 (diff) | |
download | tangerine-wallet-browser-e226b10a89d87af07c7c35ff1251a8264f3bb1b8.tar tangerine-wallet-browser-e226b10a89d87af07c7c35ff1251a8264f3bb1b8.tar.gz tangerine-wallet-browser-e226b10a89d87af07c7c35ff1251a8264f3bb1b8.tar.bz2 tangerine-wallet-browser-e226b10a89d87af07c7c35ff1251a8264f3bb1b8.tar.lz tangerine-wallet-browser-e226b10a89d87af07c7c35ff1251a8264f3bb1b8.tar.xz tangerine-wallet-browser-e226b10a89d87af07c7c35ff1251a8264f3bb1b8.tar.zst tangerine-wallet-browser-e226b10a89d87af07c7c35ff1251a8264f3bb1b8.zip |
Add react-router to allow use of the browser back button
Diffstat (limited to 'ui/app/components/wallet-view.js')
-rw-r--r-- | ui/app/components/wallet-view.js | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/ui/app/components/wallet-view.js b/ui/app/components/wallet-view.js index 3cb7a8b76..3b4443ef6 100644 --- a/ui/app/components/wallet-view.js +++ b/ui/app/components/wallet-view.js @@ -1,6 +1,8 @@ const Component = require('react').Component const connect = require('react-redux').connect const h = require('react-hyperscript') +const { withRouter } = require('react-router-dom') +const { compose } = require('recompose') const inherits = require('util').inherits const Identicon = require('./identicon') // const AccountDropdowns = require('./dropdowns/index.js').AccountDropdowns @@ -9,8 +11,12 @@ const actions = require('../actions') const BalanceComponent = require('./balance-component') const TokenList = require('./token-list') const selectors = require('../selectors') +const { ADD_TOKEN_ROUTE } = require('../routes') -module.exports = connect(mapStateToProps, mapDispatchToProps)(WalletView) +module.exports = compose( + withRouter, + connect(mapStateToProps, mapDispatchToProps) +)(WalletView) function mapStateToProps (state) { @@ -89,6 +95,7 @@ WalletView.prototype.render = function () { showAccountDetailModal, hideSidebar, showAddTokenPage, + history, } = this.props // temporary logs + fake extra wallets // console.log('walletview, selectedAccount:', selectedAccount) @@ -152,10 +159,7 @@ WalletView.prototype.render = function () { h(TokenList), h('button.wallet-view__add-token-button', { - onClick: () => { - showAddTokenPage() - hideSidebar() - }, + onClick: () => history.push(ADD_TOKEN_ROUTE), }, 'Add Token'), ]) } |