mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-22 09:23:21 +01:00
Merge pull request #2435 from danjm/NewUI-flat-disable-send-next-in-error
[NewUI] Disable Send-v2 next button when form is in error
This commit is contained in:
commit
ac3072e037
@ -383,8 +383,9 @@ SendTransactionScreen.prototype.renderFooter = function () {
|
||||
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', {
|
||||
@ -393,13 +394,7 @@ SendTransactionScreen.prototype.renderFooter = function () {
|
||||
goHome()
|
||||
},
|
||||
}, 'Cancel'),
|
||||
h(`button`, {
|
||||
className: classnames({
|
||||
'send-v2__next-btn': noErrors,
|
||||
'send-v2__next-btn__disabled': !noErrors,
|
||||
}),
|
||||
disabled: !noErrors,
|
||||
onClick: event => this.onSubmit(event),
|
||||
h(`button.send-v2__next-btn${errorClass}`, {
|
||||
}, 'Next'),
|
||||
])
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user