aboutsummaryrefslogtreecommitdiffstats
path: root/packages/instant/src/components/amount_input.tsx
diff options
context:
space:
mode:
authorfragosti <francesco.agosti93@gmail.com>2018-10-13 07:11:30 +0800
committerfragosti <francesco.agosti93@gmail.com>2018-10-13 07:11:30 +0800
commitf39541436a5088e928660b61bde7cef5153bc7a1 (patch)
tree5c6fe7ff4b9621a5cc59fe795b6feb1ad346b479 /packages/instant/src/components/amount_input.tsx
parentccf021b8bf34aa7c0714f29f9153a5a11ce682a2 (diff)
downloaddexon-sol-tools-f39541436a5088e928660b61bde7cef5153bc7a1.tar
dexon-sol-tools-f39541436a5088e928660b61bde7cef5153bc7a1.tar.gz
dexon-sol-tools-f39541436a5088e928660b61bde7cef5153bc7a1.tar.bz2
dexon-sol-tools-f39541436a5088e928660b61bde7cef5153bc7a1.tar.lz
dexon-sol-tools-f39541436a5088e928660b61bde7cef5153bc7a1.tar.xz
dexon-sol-tools-f39541436a5088e928660b61bde7cef5153bc7a1.tar.zst
dexon-sol-tools-f39541436a5088e928660b61bde7cef5153bc7a1.zip
feat: model asset meta data and add dynamic assetData state
Diffstat (limited to 'packages/instant/src/components/amount_input.tsx')
-rw-r--r--packages/instant/src/components/amount_input.tsx9
1 files changed, 5 insertions, 4 deletions
diff --git a/packages/instant/src/components/amount_input.tsx b/packages/instant/src/components/amount_input.tsx
index a2113f143..5b81a3d68 100644
--- a/packages/instant/src/components/amount_input.tsx
+++ b/packages/instant/src/components/amount_input.tsx
@@ -10,10 +10,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: _.noop.bind(_),
+ };
public render(): React.ReactNode {
const { fontColor, fontSize, value } = this.props;
return (
@@ -40,8 +43,6 @@ export class AmountInput extends React.Component<AmountInputProps> {
return;
}
}
- if (!_.isUndefined(this.props.onChange)) {
- this.props.onChange(bigNumberValue);
- }
+ this.props.onChange(bigNumberValue);
};
}