From e058efd6a890598164baa9b337f710fc66ca22c5 Mon Sep 17 00:00:00 2001 From: Dan Date: Mon, 23 Oct 2017 22:02:30 -0230 Subject: Use classnames library and disabled attribute on 'Next' button in send-v2 --- ui/app/send-v2.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/ui/app/send-v2.js b/ui/app/send-v2.js index 16e4d7801..0086faa1f 100644 --- a/ui/app/send-v2.js +++ b/ui/app/send-v2.js @@ -2,6 +2,7 @@ const { inherits } = require('util') const PersistentForm = require('../lib/persistent-form') const h = require('react-hyperscript') const connect = require('react-redux').connect +const classnames = require('classnames') const Identicon = require('./components/identicon') const FromDropdown = require('./components/send/from-dropdown') @@ -380,7 +381,6 @@ SendTransactionScreen.prototype.renderFooter = function () { } = this.props const noErrors = amountError === null && toError === null - const errorClass = noErrors ? '' : '__disabled' return h('div.send-v2__footer', [ h('button.send-v2__cancel-btn', { @@ -389,8 +389,13 @@ SendTransactionScreen.prototype.renderFooter = function () { goHome() }, }, 'Cancel'), - h(`button.send-v2__next-btn${errorClass}`, { - onClick: event => noErrors && this.onSubmit(event), + h(`button`, { + className: classnames({ + 'send-v2__next-btn': noErrors, + 'send-v2__next-btn__disabled': !noErrors, + }), + disabled: !noErrors, + onClick: event => this.onSubmit(event), }, 'Next'), ]) } -- cgit v1.2.3