Merge pull request #2587 from danjm/MM-281-currencyinput-in-gas-estimator

[NewUI] Use currency input component in gas customizer
feature/default_network_editable
Daniel Tsui 7 years ago committed by GitHub
commit f8d38f44c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      ui/app/components/customize-gas-modal/index.js
  2. 11
      ui/app/components/input-number.js

@ -117,7 +117,7 @@ CustomizeGasModal.prototype.validate = function ({ gasTotal, gasLimit }) {
let error = null
const balanceIsSufficient = isBalanceSufficient({
amount,
amount: selectedToken ? '0' : amount,
gasTotal,
balance,
selectedToken,

@ -1,6 +1,7 @@
const Component = require('react').Component
const h = require('react-hyperscript')
const inherits = require('util').inherits
const CurrencyInput = require('./currency-input')
const {
addCurrencies,
conversionGTE,
@ -50,11 +51,13 @@ InputNumber.prototype.render = function () {
const { unitLabel, step = 1, placeholder, value = 0 } = this.props
return h('div.customize-gas-input-wrapper', {}, [
h('input.customize-gas-input', {
placeholder,
h(CurrencyInput, {
className: 'customize-gas-input',
value,
step,
onChange: (e) => this.setValue(e.target.value),
placeholder,
onInputChange: newValue => {
this.setValue(newValue)
},
}),
h('span.gas-tooltip-input-detail', {}, [unitLabel]),
h('div.gas-tooltip-input-arrows', {}, [

Loading…
Cancel
Save