diff options
author | Francesco Agosti <francesco.agosti93@gmail.com> | 2018-10-17 09:18:41 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-17 09:18:41 +0800 |
commit | 336e456984e24807e3d0d5017de4ea8d1e9beb19 (patch) | |
tree | b81fcdfb7f1026b3007a9c5a81f39974d74ae483 /packages/instant/src/components/amount_input.tsx | |
parent | 35b001b0818eda5a55e0c5f9fad9ec7122c28745 (diff) | |
parent | 32beeae2f0fa4538f12036aca8dd8d30b1de8bc9 (diff) | |
download | dexon-0x-contracts-336e456984e24807e3d0d5017de4ea8d1e9beb19.tar.gz dexon-0x-contracts-336e456984e24807e3d0d5017de4ea8d1e9beb19.tar.zst dexon-0x-contracts-336e456984e24807e3d0d5017de4ea8d1e9beb19.zip |
Merge pull request #1131 from 0xProject/feature/instant/move-features-over-from-zrx-buyer
[instant][types][order-utils][asset-buyer] Move over and clean up features from zrx-buyer
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); }; } |