aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorDan <danjm.com@gmail.com>2017-09-13 23:11:03 +0800
committerChi Kei Chan <chikeichan@gmail.com>2017-09-14 05:24:48 +0800
commita5ab91e572eec05450a760d4a65e3a28df67c0d1 (patch)
tree136a719c3b549d1e59e1a70630f1e5e2a1b68d42 /ui
parente2dc9328fcd227530156727af95a10ca4a68f0fe (diff)
downloadtangerine-wallet-browser-a5ab91e572eec05450a760d4a65e3a28df67c0d1.tar.gz
tangerine-wallet-browser-a5ab91e572eec05450a760d4a65e3a28df67c0d1.tar.zst
tangerine-wallet-browser-a5ab91e572eec05450a760d4a65e3a28df67c0d1.zip
Enables Cancel button in confirmation screen.
Diffstat (limited to 'ui')
-rw-r--r--ui/app/components/pending-tx.js13
-rw-r--r--ui/app/css/itcss/components/confirm.scss1
2 files changed, 12 insertions, 2 deletions
diff --git a/ui/app/components/pending-tx.js b/ui/app/components/pending-tx.js
index 0bc995afb..69dd2107a 100644
--- a/ui/app/components/pending-tx.js
+++ b/ui/app/components/pending-tx.js
@@ -48,6 +48,7 @@ function mapDispatchToProps (dispatch) {
return {
setCurrentCurrencyToUSD: () => dispatch(actions.setCurrentCurrency('USD')),
backToAccountDetail: address => dispatch(actions.backToAccountDetail(address)),
+ cancelTransaction: ({ id }) => dispatch(actions.cancelTx({ id }))
}
}
@@ -306,7 +307,7 @@ PendingTx.prototype.render = function () {
]),
h('form#pending-tx-form.flex-column.flex-center', {
- onSubmit: this.onSubmit,
+ // onSubmit: this.onSubmit,
}, [
// Reset Button
// h('button', {
@@ -320,7 +321,9 @@ PendingTx.prototype.render = function () {
h('button.confirm-screen-confirm-button', ['CONFIRM']),
// Cancel Button
- h('button.cancel.btn-light.confirm-screen-cancel-button', {}, 'CANCEL'),
+ h('div.cancel.btn-light.confirm-screen-cancel-button', {
+ onClick: (event) => this.cancel(event, txMeta),
+ }, 'CANCEL'),
]),
])
)
@@ -366,6 +369,7 @@ PendingTx.prototype.onSubmit = function (event) {
const txMeta = this.gatherTxMeta()
const valid = this.checkValidity()
this.setState({ valid, submitting: true })
+
if (valid && this.verifyGasParams()) {
this.props.sendTransaction(txMeta, event)
} else {
@@ -374,6 +378,11 @@ PendingTx.prototype.onSubmit = function (event) {
}
}
+PendingTx.prototype.cancel = function (event, txMeta) {
+ event.preventDefault()
+ this.props.cancelTransaction(txMeta)
+}
+
PendingTx.prototype.checkValidity = function () {
const form = this.getFormEl()
const valid = form.checkValidity()
diff --git a/ui/app/css/itcss/components/confirm.scss b/ui/app/css/itcss/components/confirm.scss
index 12322462e..e8169ffea 100644
--- a/ui/app/css/itcss/components/confirm.scss
+++ b/ui/app/css/itcss/components/confirm.scss
@@ -249,6 +249,7 @@ section .confirm-screen-account-number,
padding-bottom: 15px;
font-size: 16px;
box-shadow: none;
+ cursor: pointer;
}
#pending-tx-form {