mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Merge pull request #2587 from danjm/MM-281-currencyinput-in-gas-estimator
[NewUI] Use currency input component in gas customizer
This commit is contained in:
commit
f8d38f44c2
@ -117,7 +117,7 @@ CustomizeGasModal.prototype.validate = function ({ gasTotal, gasLimit }) {
|
|||||||
let error = null
|
let error = null
|
||||||
|
|
||||||
const balanceIsSufficient = isBalanceSufficient({
|
const balanceIsSufficient = isBalanceSufficient({
|
||||||
amount,
|
amount: selectedToken ? '0' : amount,
|
||||||
gasTotal,
|
gasTotal,
|
||||||
balance,
|
balance,
|
||||||
selectedToken,
|
selectedToken,
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
const Component = require('react').Component
|
const Component = require('react').Component
|
||||||
const h = require('react-hyperscript')
|
const h = require('react-hyperscript')
|
||||||
const inherits = require('util').inherits
|
const inherits = require('util').inherits
|
||||||
|
const CurrencyInput = require('./currency-input')
|
||||||
const {
|
const {
|
||||||
addCurrencies,
|
addCurrencies,
|
||||||
conversionGTE,
|
conversionGTE,
|
||||||
@ -50,11 +51,13 @@ InputNumber.prototype.render = function () {
|
|||||||
const { unitLabel, step = 1, placeholder, value = 0 } = this.props
|
const { unitLabel, step = 1, placeholder, value = 0 } = this.props
|
||||||
|
|
||||||
return h('div.customize-gas-input-wrapper', {}, [
|
return h('div.customize-gas-input-wrapper', {}, [
|
||||||
h('input.customize-gas-input', {
|
h(CurrencyInput, {
|
||||||
placeholder,
|
className: 'customize-gas-input',
|
||||||
value,
|
value,
|
||||||
step,
|
placeholder,
|
||||||
onChange: (e) => this.setValue(e.target.value),
|
onInputChange: newValue => {
|
||||||
|
this.setValue(newValue)
|
||||||
|
},
|
||||||
}),
|
}),
|
||||||
h('span.gas-tooltip-input-detail', {}, [unitLabel]),
|
h('span.gas-tooltip-input-detail', {}, [unitLabel]),
|
||||||
h('div.gas-tooltip-input-arrows', {}, [
|
h('div.gas-tooltip-input-arrows', {}, [
|
||||||
|
Loading…
Reference in New Issue
Block a user