aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/wallet-view.js
diff options
context:
space:
mode:
authorkumavis <kumavis@users.noreply.github.com>2018-04-10 01:55:46 +0800
committerGitHub <noreply@github.com>2018-04-10 01:55:46 +0800
commit4cae3d3b0d2a9cc0279e44de256e7fc7e219dca1 (patch)
tree3439d92871f38765cf5dfa4ac310b11aeb5068bb /ui/app/components/wallet-view.js
parent2511a9e634234135862259510a38b69308c2b81b (diff)
parent1e6f062bb6bbc39d6ab21a351fdb0d3bcab4d7d5 (diff)
downloadtangerine-wallet-browser-4cae3d3b0d2a9cc0279e44de256e7fc7e219dca1.tar
tangerine-wallet-browser-4cae3d3b0d2a9cc0279e44de256e7fc7e219dca1.tar.gz
tangerine-wallet-browser-4cae3d3b0d2a9cc0279e44de256e7fc7e219dca1.tar.bz2
tangerine-wallet-browser-4cae3d3b0d2a9cc0279e44de256e7fc7e219dca1.tar.lz
tangerine-wallet-browser-4cae3d3b0d2a9cc0279e44de256e7fc7e219dca1.tar.xz
tangerine-wallet-browser-4cae3d3b0d2a9cc0279e44de256e7fc7e219dca1.tar.zst
tangerine-wallet-browser-4cae3d3b0d2a9cc0279e44de256e7fc7e219dca1.zip
Merge pull request #3921 from MetaMask/gh-3736-react-router
Add react-router integration
Diffstat (limited to 'ui/app/components/wallet-view.js')
-rw-r--r--ui/app/components/wallet-view.js18
1 files changed, 10 insertions, 8 deletions
diff --git a/ui/app/components/wallet-view.js b/ui/app/components/wallet-view.js
index e6b94ad12..e3e1b8903 100644
--- a/ui/app/components/wallet-view.js
+++ b/ui/app/components/wallet-view.js
@@ -2,6 +2,8 @@ const Component = require('react').Component
const PropTypes = require('prop-types')
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 classnames = require('classnames')
const Identicon = require('./identicon')
@@ -12,14 +14,17 @@ 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 = compose(
+ withRouter,
+ connect(mapStateToProps, mapDispatchToProps)
+)(WalletView)
WalletView.contextTypes = {
t: PropTypes.func,
}
-module.exports = connect(mapStateToProps, mapDispatchToProps)(WalletView)
-
-
function mapStateToProps (state) {
return {
@@ -97,7 +102,7 @@ WalletView.prototype.render = function () {
keyrings,
showAccountDetailModal,
hideSidebar,
- showAddTokenPage,
+ history,
} = this.props
// temporary logs + fake extra wallets
// console.log('walletview, selectedAccount:', selectedAccount)
@@ -174,10 +179,7 @@ WalletView.prototype.render = function () {
h(TokenList),
h('button.btn-primary.wallet-view__add-token-button', {
- onClick: () => {
- showAddTokenPage()
- hideSidebar()
- },
+ onClick: () => history.push(ADD_TOKEN_ROUTE),
}, this.context.t('addToken')),
])
}