aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/send-v2.js
diff options
context:
space:
mode:
authorDan <danjm.com@gmail.com>2017-10-21 10:36:42 +0800
committerDan <danjm.com@gmail.com>2017-10-24 03:17:55 +0800
commit0a436dcf9a1283a8452966fea2508801de589ab7 (patch)
tree3e6de31208f6b77538f0c38c94d760755244f9c8 /ui/app/send-v2.js
parent0cbaec16f3c373bacf02efb44a198e58152cb60b (diff)
downloadtangerine-wallet-browser-0a436dcf9a1283a8452966fea2508801de589ab7.tar
tangerine-wallet-browser-0a436dcf9a1283a8452966fea2508801de589ab7.tar.gz
tangerine-wallet-browser-0a436dcf9a1283a8452966fea2508801de589ab7.tar.bz2
tangerine-wallet-browser-0a436dcf9a1283a8452966fea2508801de589ab7.tar.lz
tangerine-wallet-browser-0a436dcf9a1283a8452966fea2508801de589ab7.tar.xz
tangerine-wallet-browser-0a436dcf9a1283a8452966fea2508801de589ab7.tar.zst
tangerine-wallet-browser-0a436dcf9a1283a8452966fea2508801de589ab7.zip
Disable send-v2 next button if in error
Diffstat (limited to 'ui/app/send-v2.js')
-rw-r--r--ui/app/send-v2.js13
1 files changed, 10 insertions, 3 deletions
diff --git a/ui/app/send-v2.js b/ui/app/send-v2.js
index a9473541c..4986edf5f 100644
--- a/ui/app/send-v2.js
+++ b/ui/app/send-v2.js
@@ -382,7 +382,14 @@ SendTransactionScreen.prototype.renderForm = function () {
}
SendTransactionScreen.prototype.renderFooter = function () {
- const { goHome, clearSend } = this.props
+ const {
+ goHome,
+ clearSend,
+ errors: { amount: amountError, to: toError }
+ } = this.props
+
+ const noErrors = amountError === null && toError === null
+ const errorClass = noErrors ? '' : '__disabled'
return h('div.send-v2__footer', [
h('button.send-v2__cancel-btn', {
@@ -391,8 +398,8 @@ SendTransactionScreen.prototype.renderFooter = function () {
goHome()
},
}, 'Cancel'),
- h('button.send-v2__next-btn', {
- onClick: event => this.onSubmit(event),
+ h(`button.send-v2__next-btn${errorClass}`, {
+ onClick: event => noErrors && this.onSubmit(event),
}, 'Next'),
])
}