aboutsummaryrefslogtreecommitdiffstats
path: root/packages/instant
diff options
context:
space:
mode:
authorfragosti <francesco.agosti93@gmail.com>2018-11-13 10:48:20 +0800
committerfragosti <francesco.agosti93@gmail.com>2018-11-13 10:48:20 +0800
commit2da258f5be91c5ddda51826f08f82d713bb521f0 (patch)
tree2c02a5882fbdfda15092e40ff10ec9e1e98772a1 /packages/instant
parente9bf7206bdfaac665ed4c838a38d0929983b367d (diff)
downloaddexon-sol-tools-2da258f5be91c5ddda51826f08f82d713bb521f0.tar
dexon-sol-tools-2da258f5be91c5ddda51826f08f82d713bb521f0.tar.gz
dexon-sol-tools-2da258f5be91c5ddda51826f08f82d713bb521f0.tar.bz2
dexon-sol-tools-2da258f5be91c5ddda51826f08f82d713bb521f0.tar.lz
dexon-sol-tools-2da258f5be91c5ddda51826f08f82d713bb521f0.tar.xz
dexon-sol-tools-2da258f5be91c5ddda51826f08f82d713bb521f0.tar.zst
dexon-sol-tools-2da258f5be91c5ddda51826f08f82d713bb521f0.zip
feat: use Omit type to improve type defitions in some containers
Diffstat (limited to 'packages/instant')
-rw-r--r--packages/instant/src/containers/connected_account_payment_method.ts11
-rw-r--r--packages/instant/src/containers/selected_erc20_asset_amount_input.ts12
2 files changed, 6 insertions, 17 deletions
diff --git a/packages/instant/src/containers/connected_account_payment_method.ts b/packages/instant/src/containers/connected_account_payment_method.ts
index c20af67cc..f7f516c89 100644
--- a/packages/instant/src/containers/connected_account_payment_method.ts
+++ b/packages/instant/src/containers/connected_account_payment_method.ts
@@ -2,11 +2,11 @@ import * as React from 'react';
import { connect } from 'react-redux';
import { Dispatch } from 'redux';
-import { PaymentMethod } from '../components/payment_method';
+import { PaymentMethod, PaymentMethodProps } from '../components/payment_method';
import { Action, actions } from '../redux/actions';
import { asyncData } from '../redux/async_data';
import { State } from '../redux/reducer';
-import { Account, Network, ProviderState, StandardSlidingPanelContent } from '../types';
+import { Account, Network, Omit, ProviderState, StandardSlidingPanelContent } from '../types';
export interface ConnectedAccountPaymentMethodProps {}
@@ -20,12 +20,7 @@ interface ConnectedDispatch {
unlockWalletAndDispatchToStore: (providerState: ProviderState) => void;
}
-interface ConnectedProps {
- onInstallWalletClick: () => void;
- onUnlockWalletClick: () => void;
- account: Account;
- network: Network;
-}
+type ConnectedProps = Omit<PaymentMethodProps, keyof ConnectedAccountPaymentMethodProps>;
type FinalProps = ConnectedProps & ConnectedAccountPaymentMethodProps;
diff --git a/packages/instant/src/containers/selected_erc20_asset_amount_input.ts b/packages/instant/src/containers/selected_erc20_asset_amount_input.ts
index 93ff3db70..30eb900e6 100644
--- a/packages/instant/src/containers/selected_erc20_asset_amount_input.ts
+++ b/packages/instant/src/containers/selected_erc20_asset_amount_input.ts
@@ -6,11 +6,11 @@ import * as React from 'react';
import { connect } from 'react-redux';
import { Dispatch } from 'redux';
-import { ERC20AssetAmountInput } from '../components/erc20_asset_amount_input';
+import { ERC20AssetAmountInput, ERC20AssetAmountInputProps } from '../components/erc20_asset_amount_input';
import { Action, actions } from '../redux/actions';
import { State } from '../redux/reducer';
import { ColorOption } from '../style/theme';
-import { AffiliateInfo, ERC20Asset, OrderProcessState } from '../types';
+import { AffiliateInfo, ERC20Asset, Omit, OrderProcessState } from '../types';
import { buyQuoteUpdater } from '../util/buy_quote_updater';
export interface SelectedERC20AssetAmountInputProps {
@@ -37,13 +37,7 @@ interface ConnectedDispatch {
) => void;
}
-interface ConnectedProps {
- value?: BigNumber;
- asset?: ERC20Asset;
- onChange: (value?: BigNumber, asset?: ERC20Asset) => void;
- isDisabled: boolean;
- numberOfAssetsAvailable?: number;
-}
+type ConnectedProps = Omit<ERC20AssetAmountInputProps, keyof SelectedERC20AssetAmountInputProps>;
type FinalProps = ConnectedProps & SelectedERC20AssetAmountInputProps;