mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Add labels to clarify warning.
This commit is contained in:
parent
e7a22fc62b
commit
4903f3e71a
@ -130,17 +130,17 @@ BnAsDecimalInput.prototype.updateValidity = function (event) {
|
||||
}
|
||||
|
||||
BnAsDecimalInput.prototype.constructWarning = function () {
|
||||
const { name, min, max, scale } = this.props
|
||||
const { name, min, max, scale, suffix } = this.props
|
||||
const newMin = min && this.downsize(min.toString(10), scale)
|
||||
const newMax = max && this.downsize(max.toString(10), scale)
|
||||
let message = name ? name + ' ' : ''
|
||||
|
||||
if (min && max) {
|
||||
message += `must be greater than or equal to ${newMin} and less than or equal to ${newMax}.`
|
||||
message += `must be greater than or equal to ${newMin} ${suffix} and less than or equal to ${newMax} ${suffix}.`
|
||||
} else if (min) {
|
||||
message += `must be greater than or equal to ${newMin}.`
|
||||
message += `must be greater than or equal to ${newMin} ${suffix}.`
|
||||
} else if (max) {
|
||||
message += `must be less than or equal to ${newMax}.`
|
||||
message += `must be less than or equal to ${newMax} ${suffix}.`
|
||||
} else {
|
||||
message += 'Invalid input.'
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user