aboutsummaryrefslogtreecommitdiffstats
path: root/packages/instant/src/containers
diff options
context:
space:
mode:
authorfragosti <francesco.agosti93@gmail.com>2018-10-26 09:35:06 +0800
committerfragosti <francesco.agosti93@gmail.com>2018-10-26 09:35:06 +0800
commitd5d99b9d2e3c793a95c68c1035246644b3ae80c6 (patch)
tree880f13fd7dba96285c23986e505f3166de099a4c /packages/instant/src/containers
parentab2759f43105c0f2d441790e138840706c6759f8 (diff)
downloaddexon-sol-tools-d5d99b9d2e3c793a95c68c1035246644b3ae80c6.tar
dexon-sol-tools-d5d99b9d2e3c793a95c68c1035246644b3ae80c6.tar.gz
dexon-sol-tools-d5d99b9d2e3c793a95c68c1035246644b3ae80c6.tar.bz2
dexon-sol-tools-d5d99b9d2e3c793a95c68c1035246644b3ae80c6.tar.lz
dexon-sol-tools-d5d99b9d2e3c793a95c68c1035246644b3ae80c6.tar.xz
dexon-sol-tools-d5d99b9d2e3c793a95c68c1035246644b3ae80c6.tar.zst
dexon-sol-tools-d5d99b9d2e3c793a95c68c1035246644b3ae80c6.zip
chore: dont override toString of BigNumber and other PR feedback
Diffstat (limited to 'packages/instant/src/containers')
-rw-r--r--packages/instant/src/containers/selected_erc20_asset_amount_input.ts (renamed from packages/instant/src/containers/selected_asset_amount_input.ts)25
1 files changed, 13 insertions, 12 deletions
diff --git a/packages/instant/src/containers/selected_asset_amount_input.ts b/packages/instant/src/containers/selected_erc20_asset_amount_input.ts
index f836c6967..078f96cd4 100644
--- a/packages/instant/src/containers/selected_asset_amount_input.ts
+++ b/packages/instant/src/containers/selected_erc20_asset_amount_input.ts
@@ -11,34 +11,35 @@ import { Action, actions } from '../redux/actions';
import { State } from '../redux/reducer';
import { ColorOption } from '../style/theme';
import { AsyncProcessState, ERC20Asset } from '../types';
+import { BigNumberInput } from '../util/big_number_input';
import { errorUtil } from '../util/error';
-import { AssetAmountInput } from '../components/asset_amount_input';
+import { ERC20AssetAmountInput } from '../components/erc20_asset_amount_input';
-export interface SelectedAssetAmountInputProps {
+export interface SelectedERC20AssetAmountInputProps {
fontColor?: ColorOption;
startingFontSizePx: number;
}
interface ConnectedState {
assetBuyer?: AssetBuyer;
- value?: BigNumber;
+ value?: BigNumberInput;
asset?: ERC20Asset;
}
interface ConnectedDispatch {
- updateBuyQuote: (assetBuyer?: AssetBuyer, value?: BigNumber, asset?: ERC20Asset) => void;
+ updateBuyQuote: (assetBuyer?: AssetBuyer, value?: BigNumberInput, asset?: ERC20Asset) => void;
}
interface ConnectedProps {
- value?: BigNumber;
+ value?: BigNumberInput;
asset?: ERC20Asset;
- onChange: (value?: BigNumber, asset?: ERC20Asset) => void;
+ onChange: (value?: BigNumberInput, asset?: ERC20Asset) => void;
}
-type FinalProps = ConnectedProps & SelectedAssetAmountInputProps;
+type FinalProps = ConnectedProps & SelectedERC20AssetAmountInputProps;
-const mapStateToProps = (state: State, _ownProps: SelectedAssetAmountInputProps): ConnectedState => {
+const mapStateToProps = (state: State, _ownProps: SelectedERC20AssetAmountInputProps): ConnectedState => {
const selectedAsset = state.selectedAsset;
if (_.isUndefined(selectedAsset) || selectedAsset.metaData.assetProxyId !== AssetProxyId.ERC20) {
return {
@@ -82,7 +83,7 @@ const debouncedUpdateBuyQuoteAsync = _.debounce(updateBuyQuoteAsync, 200, { trai
const mapDispatchToProps = (
dispatch: Dispatch<Action>,
- _ownProps: SelectedAssetAmountInputProps,
+ _ownProps: SelectedERC20AssetAmountInputProps,
): ConnectedDispatch => ({
updateBuyQuote: (assetBuyer, value, asset) => {
// Update the input
@@ -104,7 +105,7 @@ const mapDispatchToProps = (
const mergeProps = (
connectedState: ConnectedState,
connectedDispatch: ConnectedDispatch,
- ownProps: SelectedAssetAmountInputProps,
+ ownProps: SelectedERC20AssetAmountInputProps,
): FinalProps => {
return {
...ownProps,
@@ -116,8 +117,8 @@ const mergeProps = (
};
};
-export const SelectedAssetAmountInput: React.ComponentClass<SelectedAssetAmountInputProps> = connect(
+export const SelectedERC20AssetAmountInput: React.ComponentClass<SelectedERC20AssetAmountInputProps> = connect(
mapStateToProps,
mapDispatchToProps,
mergeProps,
-)(AssetAmountInput);
+)(ERC20AssetAmountInput);