mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Disable send-v2 next button if in error
This commit is contained in:
parent
0cbaec16f3
commit
0a436dcf9a
@ -652,7 +652,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
&__next-btn,
|
&__next-btn,
|
||||||
&__cancel-btn {
|
&__cancel-btn,
|
||||||
|
&__next-btn__disabled {
|
||||||
width: 163px;
|
width: 163px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
height: 55px;
|
height: 55px;
|
||||||
@ -667,16 +668,17 @@
|
|||||||
border: 1px solid;
|
border: 1px solid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&__next-btn,
|
||||||
|
&__next-btn__disabled {
|
||||||
|
color: $curious-blue;
|
||||||
|
border-color: $curious-blue;
|
||||||
|
}
|
||||||
|
|
||||||
&__next-btn__disabled {
|
&__next-btn__disabled {
|
||||||
opacity: .5;
|
opacity: .5;
|
||||||
cursor: auto;
|
cursor: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
&__next-btn {
|
|
||||||
color: $curious-blue;
|
|
||||||
border-color: $curious-blue;
|
|
||||||
}
|
|
||||||
|
|
||||||
&__cancel-btn {
|
&__cancel-btn {
|
||||||
color: $dusty-gray;
|
color: $dusty-gray;
|
||||||
border-color: $dusty-gray;
|
border-color: $dusty-gray;
|
||||||
|
@ -382,7 +382,14 @@ SendTransactionScreen.prototype.renderForm = function () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
SendTransactionScreen.prototype.renderFooter = 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', [
|
return h('div.send-v2__footer', [
|
||||||
h('button.send-v2__cancel-btn', {
|
h('button.send-v2__cancel-btn', {
|
||||||
@ -391,8 +398,8 @@ SendTransactionScreen.prototype.renderFooter = function () {
|
|||||||
goHome()
|
goHome()
|
||||||
},
|
},
|
||||||
}, 'Cancel'),
|
}, 'Cancel'),
|
||||||
h('button.send-v2__next-btn', {
|
h(`button.send-v2__next-btn${errorClass}`, {
|
||||||
onClick: event => this.onSubmit(event),
|
onClick: event => noErrors && this.onSubmit(event),
|
||||||
}, 'Next'),
|
}, 'Next'),
|
||||||
])
|
])
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user