aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/pending-tx/confirm-send-token.js
diff options
context:
space:
mode:
authorDan <danjm.com@gmail.com>2018-04-10 03:22:26 +0800
committerDan <danjm.com@gmail.com>2018-04-10 03:22:26 +0800
commit2c4426e4de745be880a994674dc1dc74c7ec74eb (patch)
tree1de9b836026d3222b490793099b66372404b83ab /ui/app/components/pending-tx/confirm-send-token.js
parent9dbb9d12ad31d53b8911db171cb7d6b3fcb477e2 (diff)
parent4cae3d3b0d2a9cc0279e44de256e7fc7e219dca1 (diff)
downloadtangerine-wallet-browser-2c4426e4de745be880a994674dc1dc74c7ec74eb.tar
tangerine-wallet-browser-2c4426e4de745be880a994674dc1dc74c7ec74eb.tar.gz
tangerine-wallet-browser-2c4426e4de745be880a994674dc1dc74c7ec74eb.tar.bz2
tangerine-wallet-browser-2c4426e4de745be880a994674dc1dc74c7ec74eb.tar.lz
tangerine-wallet-browser-2c4426e4de745be880a994674dc1dc74c7ec74eb.tar.xz
tangerine-wallet-browser-2c4426e4de745be880a994674dc1dc74c7ec74eb.tar.zst
tangerine-wallet-browser-2c4426e4de745be880a994674dc1dc74c7ec74eb.zip
Merge branch 'master' into i3580-InternationalizeCurrency
Diffstat (limited to 'ui/app/components/pending-tx/confirm-send-token.js')
-rw-r--r--ui/app/components/pending-tx/confirm-send-token.js22
1 files changed, 18 insertions, 4 deletions
diff --git a/ui/app/components/pending-tx/confirm-send-token.js b/ui/app/components/pending-tx/confirm-send-token.js
index 65b9b9d07..3d59ab3fd 100644
--- a/ui/app/components/pending-tx/confirm-send-token.js
+++ b/ui/app/components/pending-tx/confirm-send-token.js
@@ -1,4 +1,6 @@
const Component = require('react').Component
+const { withRouter } = require('react-router-dom')
+const { compose } = require('recompose')
const PropTypes = require('prop-types')
const connect = require('react-redux').connect
const h = require('react-hyperscript')
@@ -35,12 +37,16 @@ const {
getSelectedAddress,
getSelectedTokenContract,
} = require('../../selectors')
+const { SEND_ROUTE, DEFAULT_ROUTE } = require('../../routes')
ConfirmSendToken.contextTypes = {
t: PropTypes.func,
}
-module.exports = connect(mapStateToProps, mapDispatchToProps)(ConfirmSendToken)
+module.exports = compose(
+ withRouter,
+ connect(mapStateToProps, mapDispatchToProps)
+)(ConfirmSendToken)
function mapStateToProps (state, ownProps) {
@@ -149,6 +155,12 @@ function ConfirmSendToken () {
this.onSubmit = this.onSubmit.bind(this)
}
+ConfirmSendToken.prototype.editTransaction = function (txMeta) {
+ const { editTransaction, history } = this.props
+ editTransaction(txMeta)
+ history.push(SEND_ROUTE)
+}
+
ConfirmSendToken.prototype.updateComponentSendErrors = function (prevProps) {
const {
balance: oldBalance,
@@ -423,7 +435,6 @@ ConfirmSendToken.prototype.convertToRenderableCurrency = function (value, curren
}
ConfirmSendToken.prototype.render = function () {
- const { editTransaction } = this.props
const txMeta = this.gatherTxMeta()
const {
from: {
@@ -450,7 +461,7 @@ ConfirmSendToken.prototype.render = function () {
h('div.page-container', [
h('div.page-container__header', [
!txMeta.lastGasPrice && h('button.confirm-screen-back-button', {
- onClick: () => editTransaction(txMeta),
+ onClick: () => this.editTransaction(txMeta),
}, this.context.t('edit')),
h('div.page-container__title', title),
h('div.page-container__subtitle', subtitle),
@@ -530,7 +541,9 @@ ConfirmSendToken.prototype.render = function () {
}, this.context.t('cancel')),
// Accept Button
- h('button.btn-confirm.page-container__footer-button.allcaps', [this.context.t('confirm')]),
+ h('button.btn-confirm.page-container__footer-button.allcaps', {
+ onClick: event => this.onSubmit(event),
+ }, [this.context.t('confirm')]),
]),
]),
]),
@@ -583,6 +596,7 @@ ConfirmSendToken.prototype.cancel = function (event, txMeta) {
const { cancelTransaction } = this.props
cancelTransaction(txMeta)
+ .then(() => this.props.history.push(DEFAULT_ROUTE))
}
ConfirmSendToken.prototype.checkValidity = function () {