Skip to content

Commit

Permalink
fix: used api types instead of constant types
Browse files Browse the repository at this point in the history
  • Loading branch information
hirad-deriv committed Nov 17, 2023
1 parent d456b1e commit 1128c09
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions packages/cfd/src/Components/props.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export type TCFDPlatform = 'dxtrade' | 'mt5' | 'ctrader' | 'derivez';

export type TCFDsPlatformType = 'dxtrade' | 'derivez' | 'mt5' | 'ctrader' | '';

export type TShortcode = 'svg' | 'bvi' | 'labuan' | 'vanuatu' | 'maltainvest';
export type TShortcode = DetailsOfEachMT5Loginid['landing_company_short'];

export type TCFDAccountCopy = {
text: string | undefined;
Expand Down Expand Up @@ -89,7 +89,7 @@ export type TTradingPlatformAvailableAccount = {
};
signup: string[];
};
shortcode: TShortcode;
shortcode?: TShortcode;
sub_account_type: string;
account_type?: 'real' | 'demo';
landing_company_short?: TShortcode;
Expand Down Expand Up @@ -237,7 +237,7 @@ export type TTradingPlatformAccounts = {
/**
* Landing company shortcode of the DXTrade account.
*/
landing_company_short?: 'bvi' | 'labuan' | 'malta' | 'maltainvest' | 'svg' | 'vanuatu';
landing_company_short?: DetailsOfEachMT5Loginid['landing_company_short'];
/**
* Login of DXTrade account.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const CFDCompareAccountsButton = observer(({ trading_platforms, is_demo }: TComp
const history = useHistory();

const market_type = getMarketType(trading_platforms);
const market_type_shortcode = market_type.concat('_', trading_platforms.shortcode);
const market_type_shortcode = market_type.concat('_', trading_platforms.shortcode ?? '');
const {
modules: { cfd },
common,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { REGION } from '../../Helpers/cfd-config';

const CFDCompareAccountsDescription = ({ trading_platforms, is_demo }: TCompareAccountsCard) => {
const market_type = getMarketType(trading_platforms);
const market_type_shortcode = market_type.concat('_', trading_platforms.shortcode);
const market_type_shortcode = market_type.concat('_', trading_platforms.shortcode ?? '');
const juridisction_data = getJuridisctionDescription(market_type_shortcode);
const { traders_hub } = useStore();
const { selected_region } = traders_hub;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { CFD_PLATFORMS, MARKET_TYPE_SHORTCODE } from '../../Helpers/cfd-config';

const CFDCompareAccountsTitleIcon = ({ trading_platforms, is_eu_user, is_demo }: TCompareAccountsCard) => {
const market_type = !is_eu_user ? getMarketType(trading_platforms) : 'CFDs';
const market_type_shortcode = market_type.concat('_', trading_platforms.shortcode);
const market_type_shortcode = market_type.concat('_', trading_platforms.shortcode ?? '');
const jurisdiction_card_icon =
trading_platforms.platform === CFD_PLATFORMS.DXTRADE || trading_platforms.platform === CFD_PLATFORMS.CTRADER
? getAccountIcon(trading_platforms.platform)
Expand Down
2 changes: 1 addition & 1 deletion packages/cfd/src/Helpers/compare-accounts-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const getHighlightedIconLabel = (
is_demo?: boolean
): TInstrumentsIcon[] => {
const market_type = getMarketType(trading_platforms);
const market_type_shortcode = market_type.concat('_', trading_platforms.shortcode);
const market_type_shortcode = market_type.concat('_', trading_platforms.shortcode ?? '');
// Forex for these: MT5 Financial Vanuatu, MT5 Financial Labuan
const forex_label =
market_type_shortcode === MARKET_TYPE_SHORTCODE.FINANCIAL_LABUAN ||
Expand Down
4 changes: 2 additions & 2 deletions packages/stores/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ type TTradingPlatformAvailableAccount = {
};
signup: string[];
};
shortcode: 'bvi' | 'labuan' | 'svg' | 'vanuatu' | 'maltainvest';
shortcode?: DetailsOfEachMT5Loginid['landing_company_short'];
sub_account_type: string;
};

Expand Down Expand Up @@ -879,7 +879,7 @@ type TTradersHubStore = {
action_type: 'get' | 'none' | 'trade' | 'dxtrade' | 'multi-action';
key: string;
name: string;
landing_company_short?: 'bvi' | 'labuan' | 'svg' | 'vanuatu' | 'maltainvest';
landing_company_short?: DetailsOfEachMT5Loginid['landing_company_short'];
platform?: string;
description?: string;
market_type?: 'all' | 'financial' | 'synthetic';
Expand Down

0 comments on commit 1128c09

Please sign in to comment.