diff options
author | fragosti <francesco.agosti93@gmail.com> | 2018-10-31 06:21:58 +0800 |
---|---|---|
committer | fragosti <francesco.agosti93@gmail.com> | 2018-10-31 06:21:58 +0800 |
commit | a49bf353f85c22a029db3085a620f3c031b52d73 (patch) | |
tree | 305a18cbdb2b2c5eca2d73598a8024ec6b87dfc7 /packages/instant/src/components/erc20_asset_amount_input.tsx | |
parent | d0a0af51306bf5e5b46fd8982c70b271212af42f (diff) | |
download | dexon-sol-tools-a49bf353f85c22a029db3085a620f3c031b52d73.tar dexon-sol-tools-a49bf353f85c22a029db3085a620f3c031b52d73.tar.gz dexon-sol-tools-a49bf353f85c22a029db3085a620f3c031b52d73.tar.bz2 dexon-sol-tools-a49bf353f85c22a029db3085a620f3c031b52d73.tar.lz dexon-sol-tools-a49bf353f85c22a029db3085a620f3c031b52d73.tar.xz dexon-sol-tools-a49bf353f85c22a029db3085a620f3c031b52d73.tar.zst dexon-sol-tools-a49bf353f85c22a029db3085a620f3c031b52d73.zip |
feat: refactor animation code
Diffstat (limited to 'packages/instant/src/components/erc20_asset_amount_input.tsx')
-rw-r--r-- | packages/instant/src/components/erc20_asset_amount_input.tsx | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/packages/instant/src/components/erc20_asset_amount_input.tsx b/packages/instant/src/components/erc20_asset_amount_input.tsx index 4108fd0e8..bed1b3b4e 100644 --- a/packages/instant/src/components/erc20_asset_amount_input.tsx +++ b/packages/instant/src/components/erc20_asset_amount_input.tsx @@ -15,7 +15,7 @@ export interface ERC20AssetAmountInputProps { asset?: ERC20Asset; value?: BigNumberInput; onChange: (value?: BigNumberInput, asset?: ERC20Asset) => void; - onSymbolClick: (asset?: ERC20Asset) => void; + onSymbolClick?: (asset?: ERC20Asset) => void; startingFontSizePx: number; fontColor?: ColorOption; isDisabled: boolean; @@ -28,7 +28,6 @@ export interface ERC20AssetAmountInputState { export class ERC20AssetAmountInput extends React.Component<ERC20AssetAmountInputProps, ERC20AssetAmountInputState> { public static defaultProps = { onChange: util.boundNoop, - onSymbolClick: util.boundNoop, isDisabled: false, }; constructor(props: ERC20AssetAmountInputProps) { @@ -112,7 +111,9 @@ export class ERC20AssetAmountInput extends React.Component<ERC20AssetAmountInput }); }; private readonly _handleSymbolClick = () => { - this.props.onSymbolClick(this.props.asset); + if (this.props.onSymbolClick) { + this.props.onSymbolClick(this.props.asset); + } }; // For assets with symbols of different length, // start scaling the input at different character lengths |