From e226b10a89d87af07c7c35ff1251a8264f3bb1b8 Mon Sep 17 00:00:00 2001 From: Alexander Tseung Date: Tue, 28 Nov 2017 20:24:35 -0800 Subject: Add react-router to allow use of the browser back button --- ui/app/send-v2.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'ui/app/send-v2.js') diff --git a/ui/app/send-v2.js b/ui/app/send-v2.js index e1b88f0db..32bbdfe6e 100644 --- a/ui/app/send-v2.js +++ b/ui/app/send-v2.js @@ -28,6 +28,7 @@ const { isTokenBalanceSufficient, } = require('./components/send/send-utils') const { isValidAddress } = require('./util') +const { CONFIRM_TRANSACTION_ROUTE } = require('./routes') module.exports = SendTransactionScreen @@ -508,9 +509,9 @@ SendTransactionScreen.prototype.renderForm = function () { SendTransactionScreen.prototype.renderFooter = function () { const { - goHome, clearSend, errors: { amount: amountError, to: toError }, + history, } = this.props const noErrors = !amountError && toError === null @@ -520,7 +521,7 @@ SendTransactionScreen.prototype.renderFooter = function () { h('button.send-v2__cancel-btn', { onClick: () => { clearSend() - goHome() + history.goBack() }, }, 'Cancel'), h(`button.send-v2__next-btn${errorClass}`, { @@ -555,7 +556,7 @@ SendTransactionScreen.prototype.addToAddressBookIfNew = function (newAddress) { SendTransactionScreen.prototype.onSubmit = function (event) { event.preventDefault() const { - from: {address: from}, + from: { address: from }, to, amount, gasLimit: gas, @@ -578,6 +579,7 @@ SendTransactionScreen.prototype.onSubmit = function (event) { if (editingTransactionId) { backToConfirmScreen(editingTransactionId) + this.props.history.push(CONFIRM_TRANSACTION_ROUTE) return } @@ -596,4 +598,6 @@ SendTransactionScreen.prototype.onSubmit = function (event) { selectedToken ? signTokenTx(selectedToken.address, to, amount, txParams) : signTx(txParams) + + this.props.history.push(CONFIRM_TRANSACTION_ROUTE) } -- cgit From 2fd9e58e612e9fe341c9107a677238a566e3c1b8 Mon Sep 17 00:00:00 2001 From: Alexander Tseung Date: Thu, 1 Feb 2018 14:13:08 -0800 Subject: Fix lint errors --- ui/app/send-v2.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ui/app/send-v2.js') diff --git a/ui/app/send-v2.js b/ui/app/send-v2.js index 5eb90143e..7cee46c9c 100644 --- a/ui/app/send-v2.js +++ b/ui/app/send-v2.js @@ -659,7 +659,7 @@ SendTransactionScreen.prototype.onSubmit = function (event) { selectedToken ? signTokenTx(selectedToken.address, to, amount, txParams) : signTx(txParams) - - this.props.history.push(CONFIRM_TRANSACTION_ROUTE) } + + this.props.history.push(CONFIRM_TRANSACTION_ROUTE) } -- cgit From 58f52b2b8de9efd43896e23ab0ac9972f45bb278 Mon Sep 17 00:00:00 2001 From: Alexander Tseung Date: Wed, 28 Mar 2018 13:21:53 -0700 Subject: Fix merge conflicts. Refactor onboarding flow. --- ui/app/send-v2.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ui/app/send-v2.js') diff --git a/ui/app/send-v2.js b/ui/app/send-v2.js index df819dbd8..9e0ede720 100644 --- a/ui/app/send-v2.js +++ b/ui/app/send-v2.js @@ -186,7 +186,7 @@ SendTransactionScreen.prototype.componentDidUpdate = function (prevProps) { } SendTransactionScreen.prototype.renderHeader = function () { - const { selectedToken, clearSend, goHome } = this.props + const { selectedToken, clearSend, history } = this.props return h('div.page-container__header', [ @@ -197,7 +197,7 @@ SendTransactionScreen.prototype.renderHeader = function () { h('div.page-container__header-close', { onClick: () => { clearSend() - goHome() + history.goBack() }, }), -- cgit From 6277a4c46aa2fd94f0fff047aff346d7f255224d Mon Sep 17 00:00:00 2001 From: Alexander Tseung Date: Mon, 2 Apr 2018 02:59:49 -0700 Subject: Refactor onboarding flow --- ui/app/send-v2.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'ui/app/send-v2.js') diff --git a/ui/app/send-v2.js b/ui/app/send-v2.js index e483008c6..abbb97643 100644 --- a/ui/app/send-v2.js +++ b/ui/app/send-v2.js @@ -29,7 +29,7 @@ const { isTokenBalanceSufficient, } = require('./components/send/send-utils') const { isValidAddress } = require('./util') -const { CONFIRM_TRANSACTION_ROUTE } = require('./routes') +const { CONFIRM_TRANSACTION_ROUTE, DEFAULT_ROUTE } = require('./routes') SendTransactionScreen.contextTypes = { t: PropTypes.func, @@ -201,7 +201,7 @@ SendTransactionScreen.prototype.renderHeader = function () { h('div.page-container__header-close', { onClick: () => { clearSend() - history.goBack() + history.push(DEFAULT_ROUTE) }, }), @@ -521,7 +521,7 @@ SendTransactionScreen.prototype.renderFooter = function () { h('button.btn-secondary--lg.page-container__footer-button', { onClick: () => { clearSend() - history.goBack() + history.push(DEFAULT_ROUTE) }, }, this.context.t('cancel')), h('button.btn-primary--lg.page-container__footer-button', { -- cgit