aboutsummaryrefslogtreecommitdiffstats
path: root/packages/instant/src/components
diff options
context:
space:
mode:
authorSteve Klebanoff <steve.klebanoff@gmail.com>2018-11-02 07:32:14 +0800
committerSteve Klebanoff <steve.klebanoff@gmail.com>2018-11-02 07:32:14 +0800
commita2e1bf0e6287e86c226b0801311f6f4498c893ed (patch)
tree5c03514c0d0afce1aba61341c079822030e0ece0 /packages/instant/src/components
parent7c30fd4b2da83c9522f9137f4d18e6c308f2b66f (diff)
downloaddexon-0x-contracts-a2e1bf0e6287e86c226b0801311f6f4498c893ed.tar.gz
dexon-0x-contracts-a2e1bf0e6287e86c226b0801311f6f4498c893ed.tar.zst
dexon-0x-contracts-a2e1bf0e6287e86c226b0801311f6f4498c893ed.zip
Getting rid of BigNumberInput in favor of BigNumber
Diffstat (limited to 'packages/instant/src/components')
-rw-r--r--packages/instant/src/components/erc20_asset_amount_input.tsx8
-rw-r--r--packages/instant/src/components/scaling_amount_input.tsx10
-rw-r--r--packages/instant/src/components/zero_ex_instant_provider.tsx4
3 files changed, 11 insertions, 11 deletions
diff --git a/packages/instant/src/components/erc20_asset_amount_input.tsx b/packages/instant/src/components/erc20_asset_amount_input.tsx
index b1fec6405..a67d7d5db 100644
--- a/packages/instant/src/components/erc20_asset_amount_input.tsx
+++ b/packages/instant/src/components/erc20_asset_amount_input.tsx
@@ -1,10 +1,10 @@
+import { BigNumber } from '@0x/utils';
import * as _ from 'lodash';
import * as React from 'react';
import { ColorOption, transparentWhite } from '../style/theme';
import { ERC20Asset } from '../types';
import { assetUtils } from '../util/asset';
-import { BigNumberInput } from '../util/big_number_input';
import { util } from '../util/util';
import { ScalingAmountInput } from './scaling_amount_input';
@@ -13,8 +13,8 @@ import { Container, Flex, Icon, Text } from './ui';
// Asset amounts only apply to ERC20 assets
export interface ERC20AssetAmountInputProps {
asset?: ERC20Asset;
- value?: BigNumberInput;
- onChange: (value?: BigNumberInput, asset?: ERC20Asset) => void;
+ value?: BigNumber;
+ onChange: (value?: BigNumber, asset?: ERC20Asset) => void;
onSelectAssetClick?: (asset?: ERC20Asset) => void;
startingFontSizePx: number;
fontColor?: ColorOption;
@@ -102,7 +102,7 @@ export class ERC20AssetAmountInput extends React.Component<ERC20AssetAmountInput
</Container>
);
};
- private readonly _handleChange = (value?: BigNumberInput): void => {
+ private readonly _handleChange = (value?: BigNumber): void => {
this.props.onChange(value, this.props.asset);
};
private readonly _handleFontSizeChange = (fontSizePx: number): void => {
diff --git a/packages/instant/src/components/scaling_amount_input.tsx b/packages/instant/src/components/scaling_amount_input.tsx
index cfbf3b7cc..4b046e8da 100644
--- a/packages/instant/src/components/scaling_amount_input.tsx
+++ b/packages/instant/src/components/scaling_amount_input.tsx
@@ -1,8 +1,8 @@
+import { BigNumber } from '@0x/utils';
import * as _ from 'lodash';
import * as React from 'react';
import { ColorOption } from '../style/theme';
-import { BigNumberInput } from '../util/big_number_input';
import { util } from '../util/util';
import { ScalingInput } from './scaling_input';
@@ -12,8 +12,8 @@ export interface ScalingAmountInputProps {
maxFontSizePx: number;
textLengthThreshold: number;
fontColor?: ColorOption;
- value?: BigNumberInput;
- onChange: (value?: BigNumberInput) => void;
+ value?: BigNumber;
+ onChange: (value?: BigNumber) => void;
onFontSizeChange: (fontSizePx: number) => void;
}
@@ -32,7 +32,7 @@ export class ScalingAmountInput extends React.Component<ScalingAmountInputProps>
onFontSizeChange={onFontSizeChange}
fontColor={fontColor}
onChange={this._handleChange}
- value={!_.isUndefined(value) ? value.toDisplayString() : ''}
+ value={!_.isUndefined(value) ? value.toString() : ''}
placeholder="0.00"
emptyInputWidthCh={3.5}
isDisabled={this.props.isDisabled}
@@ -44,7 +44,7 @@ export class ScalingAmountInput extends React.Component<ScalingAmountInputProps>
let bigNumberValue;
if (!_.isEmpty(value)) {
try {
- bigNumberValue = new BigNumberInput(value);
+ bigNumberValue = new BigNumber(value);
} catch {
// We don't want to allow values that can't be a BigNumber, so don't even call onChange.
return;
diff --git a/packages/instant/src/components/zero_ex_instant_provider.tsx b/packages/instant/src/components/zero_ex_instant_provider.tsx
index 8c1025723..9391c03f7 100644
--- a/packages/instant/src/components/zero_ex_instant_provider.tsx
+++ b/packages/instant/src/components/zero_ex_instant_provider.tsx
@@ -1,5 +1,6 @@
import { AssetBuyer } from '@0x/asset-buyer';
import { ObjectMap, SignedOrder } from '@0x/types';
+import { BigNumber } from '@0x/utils';
import * as _ from 'lodash';
import * as React from 'react';
import { Provider } from 'react-redux';
@@ -11,7 +12,6 @@ import { store, Store } from '../redux/store';
import { fonts } from '../style/fonts';
import { AssetMetaData, Network } from '../types';
import { assetUtils } from '../util/asset';
-import { BigNumberInput } from '../util/big_number_input';
import { errorFlasher } from '../util/error_flasher';
import { gasPriceEstimator } from '../util/gas_price_estimator';
import { getProvider } from '../util/provider';
@@ -64,7 +64,7 @@ export class ZeroExInstantProvider extends React.Component<ZeroExInstantProvider
selectedAsset: assetUtils.createAssetFromAssetData(props.assetData, completeAssetMetaDataMap, networkId),
selectedAssetAmount: _.isUndefined(props.defaultAssetBuyAmount)
? state.selectedAssetAmount
- : new BigNumberInput(props.defaultAssetBuyAmount),
+ : new BigNumber(props.defaultAssetBuyAmount),
assetMetaDataMap: completeAssetMetaDataMap,
};
return storeStateFromProps;