diff options
author | Kadinsky <kandinsky454@protonmail.ch> | 2018-10-18 19:14:32 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-18 19:14:32 +0800 |
commit | 47dc384ea36fecbcf01eb9b3f20936331b43a0c6 (patch) | |
tree | e53a0c2d20b9f3271916144528f2214b32a3a83a /packages/instant/src/components/amount_input.tsx | |
parent | c333d093b585fa0250a6973f2d396eb3cf227334 (diff) | |
parent | e7c6f2a35795610645598deba2c14ceeda6acc89 (diff) | |
download | dexon-0x-contracts-47dc384ea36fecbcf01eb9b3f20936331b43a0c6.tar dexon-0x-contracts-47dc384ea36fecbcf01eb9b3f20936331b43a0c6.tar.gz dexon-0x-contracts-47dc384ea36fecbcf01eb9b3f20936331b43a0c6.tar.bz2 dexon-0x-contracts-47dc384ea36fecbcf01eb9b3f20936331b43a0c6.tar.lz dexon-0x-contracts-47dc384ea36fecbcf01eb9b3f20936331b43a0c6.tar.xz dexon-0x-contracts-47dc384ea36fecbcf01eb9b3f20936331b43a0c6.tar.zst dexon-0x-contracts-47dc384ea36fecbcf01eb9b3f20936331b43a0c6.zip |
Merge pull request #1140 from 0xProject/reSkinReferenceDocs
Move Doc Reference Pages & Wiki into Developer Section of Website
Diffstat (limited to 'packages/instant/src/components/amount_input.tsx')
-rw-r--r-- | packages/instant/src/components/amount_input.tsx | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/packages/instant/src/components/amount_input.tsx b/packages/instant/src/components/amount_input.tsx index 38810063d..7644f5f67 100644 --- a/packages/instant/src/components/amount_input.tsx +++ b/packages/instant/src/components/amount_input.tsx @@ -3,6 +3,7 @@ import * as _ from 'lodash'; import * as React from 'react'; import { ColorOption } from '../style/theme'; +import { util } from '../util/util'; import { Container, Input } from './ui'; @@ -10,10 +11,13 @@ export interface AmountInputProps { fontColor?: ColorOption; fontSize?: string; value?: BigNumber; - onChange?: (value?: BigNumber) => void; + onChange: (value?: BigNumber) => void; } export class AmountInput extends React.Component<AmountInputProps> { + public static defaultProps = { + onChange: util.boundNoop, + }; public render(): React.ReactNode { const { fontColor, fontSize, value } = this.props; return ( @@ -24,7 +28,7 @@ export class AmountInput extends React.Component<AmountInputProps> { onChange={this._handleChange} value={!_.isUndefined(value) ? value.toString() : ''} placeholder="0.00" - width="2em" + width="2.2em" /> </Container> ); @@ -40,8 +44,6 @@ export class AmountInput extends React.Component<AmountInputProps> { return; } } - if (!_.isUndefined(this.props.onChange)) { - this.props.onChange(bigNumberValue); - } + this.props.onChange(bigNumberValue); }; } |