diff options
author | kumavis <kumavis@users.noreply.github.com> | 2018-04-10 01:55:46 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-10 01:55:46 +0800 |
commit | 4cae3d3b0d2a9cc0279e44de256e7fc7e219dca1 (patch) | |
tree | 3439d92871f38765cf5dfa4ac310b11aeb5068bb /ui/app/components/signature-request.js | |
parent | 2511a9e634234135862259510a38b69308c2b81b (diff) | |
parent | 1e6f062bb6bbc39d6ab21a351fdb0d3bcab4d7d5 (diff) | |
download | tangerine-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/signature-request.js')
-rw-r--r-- | ui/app/components/signature-request.js | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/ui/app/components/signature-request.js b/ui/app/components/signature-request.js index 41415411e..b958a2d2d 100644 --- a/ui/app/components/signature-request.js +++ b/ui/app/components/signature-request.js @@ -6,6 +6,8 @@ const Identicon = require('./identicon') const connect = require('react-redux').connect const ethUtil = require('ethereumjs-util') const classnames = require('classnames') +const { compose } = require('recompose') +const { withRouter } = require('react-router-dom') const AccountDropdownMini = require('./dropdowns/account-dropdown-mini') @@ -20,6 +22,8 @@ const { conversionRateSelector, } = require('../selectors.js') +const { DEFAULT_ROUTE } = require('../routes') + function mapStateToProps (state) { return { balance: getSelectedAccount(state).balance, @@ -42,7 +46,10 @@ SignatureRequest.contextTypes = { t: PropTypes.func, } -module.exports = connect(mapStateToProps, mapDispatchToProps)(SignatureRequest) +module.exports = compose( + withRouter, + connect(mapStateToProps, mapDispatchToProps) +)(SignatureRequest) inherits(SignatureRequest, Component) @@ -229,10 +236,14 @@ SignatureRequest.prototype.renderFooter = function () { return h('div.request-signature__footer', [ h('button.btn-secondary--lg.request-signature__footer__cancel-button', { - onClick: cancel, + onClick: event => { + cancel(event).then(() => this.props.history.push(DEFAULT_ROUTE)) + }, }, this.context.t('cancel')), h('button.btn-primary--lg', { - onClick: sign, + onClick: event => { + sign(event).then(() => this.props.history.push(DEFAULT_ROUTE)) + }, }, this.context.t('sign')), ]) } |