diff --git a/packages/account/src/Sections/Security/ClosingAccount/account-has-balance.jsx b/packages/account/src/Sections/Security/ClosingAccount/account-has-balance.jsx index a4707e01e561..ff95c162a68a 100644 --- a/packages/account/src/Sections/Security/ClosingAccount/account-has-balance.jsx +++ b/packages/account/src/Sections/Security/ClosingAccount/account-has-balance.jsx @@ -1,6 +1,6 @@ import React from 'react'; import { Button, Icon, Money, ThemedScrollbars, Text } from '@deriv/components'; -import { formatMoney, getCFDAccount, getCFDAccountDisplay, CFD_PLATFORMS } from '@deriv/shared'; +import { formatMoney, getCFDAccount, getCFDAccountDisplay, CFD_PLATFORMS, getMT5Icon } from '@deriv/shared'; import { localize, Localize } from '@deriv/translations'; const getDerivAccount = (client_accounts, login_id) => @@ -161,10 +161,8 @@ const AccountHasPendingConditions = ({ {mt5_open_positions.map(account => ( ( { - const { client } = useStore(); + const { client, traders_hub } = useStore(); const { dxtrade_accounts_list, mt5_login_list, account_list } = client; + const { is_eu_user } = traders_hub; const { is_appstore } = React.useContext(PlatformContext); const [is_account_closed, setIsAccountClosed] = React.useState(false); const [is_loading, setIsLoading] = React.useState(false); @@ -233,6 +234,7 @@ const ClosingAccountReason = observer(({ onBackClick }) => { client_accounts={account_list} dxtrade_accounts_list={dxtrade_accounts_list} onBackClick={onBackClick} + is_eu={is_eu_user} /> )} {which_modal_should_render === 'inaccessible_modal' && ( diff --git a/packages/components/src/components/icon/icons.js b/packages/components/src/components/icon/icons.js index 92cdfffb3e2e..e0d173dd591f 100644 --- a/packages/components/src/components/icon/icons.js +++ b/packages/components/src/components/icon/icons.js @@ -700,9 +700,11 @@ import './mt5/ic-mt5-password-updated.svg'; import './mt5/ic-mt5-responsive.svg'; import './mt5/ic-mt5-support.svg'; import './mt5/ic-mt5-swap-free-platform.svg'; +import './mt5/ic-mt5-swap-free.svg'; import './mt5/ic-mt5-synthetic-dashboard.svg'; import './mt5/ic-mt5-synthetic-indices.svg'; import './mt5/ic-mt5-synthetic-platform.svg'; +import './mt5/ic-mt5-synthetic.svg'; import './mt5/ic-mt5-trade-types.svg'; import './option/ic-option-accumulators.svg'; import './option/ic-option-call-put-reset.svg'; diff --git a/packages/components/src/components/icon/mt5/ic-mt5-cfds.svg b/packages/components/src/components/icon/mt5/ic-mt5-cfds.svg index 590e2367a256..88174804c30a 100644 --- a/packages/components/src/components/icon/mt5/ic-mt5-cfds.svg +++ b/packages/components/src/components/icon/mt5/ic-mt5-cfds.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/packages/components/src/components/icon/mt5/ic-mt5-financial.svg b/packages/components/src/components/icon/mt5/ic-mt5-financial.svg index 239a40f9ad82..7fd867a129f0 100644 --- a/packages/components/src/components/icon/mt5/ic-mt5-financial.svg +++ b/packages/components/src/components/icon/mt5/ic-mt5-financial.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/packages/components/src/components/icon/mt5/ic-mt5-swap-free.svg b/packages/components/src/components/icon/mt5/ic-mt5-swap-free.svg new file mode 100644 index 000000000000..7b464b0951e6 --- /dev/null +++ b/packages/components/src/components/icon/mt5/ic-mt5-swap-free.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/components/src/components/icon/mt5/ic-mt5-synthetic.svg b/packages/components/src/components/icon/mt5/ic-mt5-synthetic.svg new file mode 100644 index 000000000000..b0abc3df8f0b --- /dev/null +++ b/packages/components/src/components/icon/mt5/ic-mt5-synthetic.svg @@ -0,0 +1,10 @@ + + + + + + \ No newline at end of file diff --git a/packages/shared/src/utils/cfd/cfd.ts b/packages/shared/src/utils/cfd/cfd.ts index 7c1b52962a48..049159e480b7 100644 --- a/packages/shared/src/utils/cfd/cfd.ts +++ b/packages/shared/src/utils/cfd/cfd.ts @@ -184,7 +184,7 @@ export const getCFDAccountDisplay = ({ let cfd_account_key = getCFDAccountKey({ market_type, sub_account_type, platform, shortcode }); if (!cfd_account_key) return undefined; - if (cfd_account_key === 'financial' && is_eu) { + if (cfd_account_key === 'financial_demo' && is_eu) { if (is_mt5_trade_modal) cfd_account_key = 'mt5_cfds'; else cfd_account_key = 'cfd'; } @@ -206,6 +206,11 @@ type TGetCFDAccount = TGetAccount & { is_transfer_form?: boolean; }; +type TGetMT5Icon = { + market_type: TMarketType; + is_eu?: boolean; +}; + export const getCFDAccount = ({ market_type, sub_account_type, @@ -216,7 +221,7 @@ export const getCFDAccount = ({ let cfd_account_key = getCFDAccountKey({ market_type, sub_account_type, platform }); if (!cfd_account_key) return undefined; - if (cfd_account_key === 'financial' && is_eu) { + if (cfd_account_key === 'financial_demo' && is_eu) { cfd_account_key = 'cfd'; } @@ -225,6 +230,12 @@ export const getCFDAccount = ({ return CFD_text[cfd_account_key as keyof typeof CFD_text]; }; +export const getMT5Icon = ({ market_type, is_eu }: TGetMT5Icon) => { + if (market_type === 'all' && !is_eu) return 'SwapFree'; + if (market_type === 'financial' && is_eu) return 'CFDs'; + return market_type; +}; + export const setSharedCFDText = (all_shared_CFD_text: { [key: string]: () => void }) => { CFD_text_translated = all_shared_CFD_text; };