From bbdb35c35a03c42eb4a950756bf280e6e15513b5 Mon Sep 17 00:00:00 2001 From: Dan Date: Wed, 15 Nov 2017 15:00:35 -0330 Subject: Use currency input component in input number, to improve input behaviour in gas estimator --- ui/app/components/input-number.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'ui') diff --git a/ui/app/components/input-number.js b/ui/app/components/input-number.js index 12dec2957..fd8c5c309 100644 --- a/ui/app/components/input-number.js +++ b/ui/app/components/input-number.js @@ -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', {}, [ -- cgit v1.2.3