1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

Use classnames library and disabled attribute on 'Next' button in send-v2

This commit is contained in:
Dan 2017-10-23 22:02:30 -02:30 committed by Chi Kei Chan
parent e737a9565a
commit e058efd6a8

View File

@ -2,6 +2,7 @@ const { inherits } = require('util')
const PersistentForm = require('../lib/persistent-form') const PersistentForm = require('../lib/persistent-form')
const h = require('react-hyperscript') const h = require('react-hyperscript')
const connect = require('react-redux').connect const connect = require('react-redux').connect
const classnames = require('classnames')
const Identicon = require('./components/identicon') const Identicon = require('./components/identicon')
const FromDropdown = require('./components/send/from-dropdown') const FromDropdown = require('./components/send/from-dropdown')
@ -380,7 +381,6 @@ SendTransactionScreen.prototype.renderFooter = function () {
} = this.props } = this.props
const noErrors = amountError === null && toError === null const noErrors = amountError === null && toError === null
const errorClass = noErrors ? '' : '__disabled'
return h('div.send-v2__footer', [ return h('div.send-v2__footer', [
h('button.send-v2__cancel-btn', { h('button.send-v2__cancel-btn', {
@ -389,8 +389,13 @@ SendTransactionScreen.prototype.renderFooter = function () {
goHome() goHome()
}, },
}, 'Cancel'), }, 'Cancel'),
h(`button.send-v2__next-btn${errorClass}`, { h(`button`, {
onClick: event => noErrors && this.onSubmit(event), className: classnames({
'send-v2__next-btn': noErrors,
'send-v2__next-btn__disabled': !noErrors,
}),
disabled: !noErrors,
onClick: event => this.onSubmit(event),
}, 'Next'), }, 'Next'),
]) ])
} }