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/tx-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/tx-view.js')
-rw-r--r-- | ui/app/components/tx-view.js | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/ui/app/components/tx-view.js b/ui/app/components/tx-view.js index e42a20c85..46029166e 100644 --- a/ui/app/components/tx-view.js +++ b/ui/app/components/tx-view.js @@ -3,14 +3,20 @@ const connect = require('react-redux').connect const h = require('react-hyperscript') const ethUtil = require('ethereumjs-util') const inherits = require('util').inherits +const { withRouter } = require('react-router-dom') +const { compose } = require('recompose') const actions = require('../actions') const selectors = require('../selectors') +const { SEND_ROUTE } = require('../routes') const BalanceComponent = require('./balance-component') const TxList = require('./tx-list') const Identicon = require('./identicon') -module.exports = connect(mapStateToProps, mapDispatchToProps)(TxView) +module.exports = compose( + withRouter, + connect(mapStateToProps, mapDispatchToProps) +)(TxView) function mapStateToProps (state) { const sidebarOpen = state.appState.sidebarOpen @@ -63,7 +69,7 @@ TxView.prototype.renderHeroBalance = function () { } TxView.prototype.renderButtons = function () { - const {selectedToken, showModal, showSendPage, showSendTokenPage } = this.props + const {selectedToken, showModal, history } = this.props return !selectedToken ? ( @@ -82,7 +88,7 @@ TxView.prototype.renderButtons = function () { textAlign: 'center', marginLeft: '0.8em', }, - onClick: showSendPage, + onClick: () => history.push(SEND_ROUTE), }, 'SEND'), ]) ) @@ -93,7 +99,7 @@ TxView.prototype.renderButtons = function () { textAlign: 'center', marginLeft: '0.8em', }, - onClick: showSendTokenPage, + onClick: () => history.push(SEND_ROUTE), }, 'SEND'), ]) ) |