aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorDan <danjm.com@gmail.com>2018-05-30 02:54:44 +0800
committerDan <danjm.com@gmail.com>2018-05-30 02:55:03 +0800
commitf33bb3e2fd8ba1cc30dac11017f26ba82c26a82d (patch)
tree09e67197e9e0cca023fd3bc93c69429757405a03 /ui
parentea28c8a437cddd0c2cb69809a23f1f9a0ceba0dc (diff)
downloadtangerine-wallet-browser-f33bb3e2fd8ba1cc30dac11017f26ba82c26a82d.tar
tangerine-wallet-browser-f33bb3e2fd8ba1cc30dac11017f26ba82c26a82d.tar.gz
tangerine-wallet-browser-f33bb3e2fd8ba1cc30dac11017f26ba82c26a82d.tar.bz2
tangerine-wallet-browser-f33bb3e2fd8ba1cc30dac11017f26ba82c26a82d.tar.lz
tangerine-wallet-browser-f33bb3e2fd8ba1cc30dac11017f26ba82c26a82d.tar.xz
tangerine-wallet-browser-f33bb3e2fd8ba1cc30dac11017f26ba82c26a82d.tar.zst
tangerine-wallet-browser-f33bb3e2fd8ba1cc30dac11017f26ba82c26a82d.zip
Stop using external NumericInput component.
Diffstat (limited to 'ui')
-rw-r--r--ui/app/components/send/currency-display.js23
1 files changed, 15 insertions, 8 deletions
diff --git a/ui/app/components/send/currency-display.js b/ui/app/components/send/currency-display.js
index b98ebee09..60032bca4 100644
--- a/ui/app/components/send/currency-display.js
+++ b/ui/app/components/send/currency-display.js
@@ -4,7 +4,6 @@ const inherits = require('util').inherits
const { conversionUtil, multiplyCurrencies } = require('../../conversion-util')
const currencyFormatter = require('currency-formatter')
const currencies = require('currency-formatter/currencies')
-const NumericInput = require('react-numeric-input')
module.exports = CurrencyDisplay
@@ -92,6 +91,7 @@ CurrencyDisplay.prototype.getConvertedValueToRender = function (nonFormattedValu
}
CurrencyDisplay.prototype.handleChange = function (newVal) {
+ console.log(`%^ 95 newVal`, newVal);
this.setState({ valueToRender: newVal })
this.props.onChange(this.getAmount(newVal))
}
@@ -124,27 +124,34 @@ CurrencyDisplay.prototype.render = function () {
style: {
borderColor: inError ? 'red' : null,
},
- onClick: () => this.currencyInput && this.currencyInput.focus(),
+ onClick: () => {
+ this.currencyInput && this.currencyInput.focus()
+ },
}, [
h('div.currency-display__primary-row', [
h('div.currency-display__input-wrapper', [
- h(NumericInput, {
+ h('input', {
className: primaryBalanceClassName,
value: `${valueToRender}`,
- placeholder: `0 ${primaryCurrency}`,
+ placeholder: '0',
+ type: 'number',
readOnly,
...(!readOnly ? {
- onChange: e => this.handleChange(e),
+ onChange: e => this.handleChange(e.target.value),
onBlur: () => onBlur(this.getAmount(valueToRender)),
} : {}),
- style: false,
- format: num => `${num} ${primaryCurrency}`,
- parse: stringWithCurrency => stringWithCurrency && stringWithCurrency.match(/^([.\d]+)/)[1],
+ ref: input => { this.currencyInput = input },
+ style: {
+ width: this.getInputWidth(valueToRender, readOnly),
+ },
+ min: 0,
}),
+ h('span.currency-display__currency-symbol', primaryCurrency),
+
]),
]),