From 860f6373b782127e48dc78fba2bad0521d41ba4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CMatin-deriv=E2=80=9D?= Date: Wed, 3 Apr 2024 17:48:30 +0800 Subject: [PATCH 1/9] chore: initial commit --- .../ProofOfAddress/proof-of-address-container.tsx | 3 ++- packages/core/src/Stores/client-store.js | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/account/src/Sections/Verification/ProofOfAddress/proof-of-address-container.tsx b/packages/account/src/Sections/Verification/ProofOfAddress/proof-of-address-container.tsx index fe130b76660d..4e2a29d7dc37 100644 --- a/packages/account/src/Sections/Verification/ProofOfAddress/proof-of-address-container.tsx +++ b/packages/account/src/Sections/Verification/ProofOfAddress/proof-of-address-container.tsx @@ -132,7 +132,8 @@ const ProofOfAddressContainer = observer(({ onSubmit }: TProofOfAddressContainer ); if (is_loading) return ; - if (!allow_document_upload) return ; + if (!allow_document_upload || (!is_age_verified && !allow_poa_resubmission && document_status === 'none')) + return ; if (has_submitted_poa && !poa_address_mismatch) return ; if ( diff --git a/packages/core/src/Stores/client-store.js b/packages/core/src/Stores/client-store.js index 4191fbfdce46..4a1e9f0c81e9 100644 --- a/packages/core/src/Stores/client-store.js +++ b/packages/core/src/Stores/client-store.js @@ -48,8 +48,8 @@ import { getRegion, isEuCountry, isMultipliersOnly, isOptionsBlocked } from '_co const LANGUAGE_KEY = 'i18n_language'; const storage_key = 'client.accounts'; const store_name = 'client_store'; -const eu_shortcode_regex = /^maltainvest$/; -const eu_excluded_regex = /^mt$/; +const eu_shortcode_regex = new RegExp('^maltainvest$'); +const eu_excluded_regex = new RegExp('^mt$'); export default class ClientStore extends BaseStore { loginid; From 178f445c5ad25003f50d4c22830b19ae63c41cf1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CMatin-deriv=E2=80=9D?= Date: Thu, 4 Apr 2024 11:29:52 +0800 Subject: [PATCH 2/9] fix: failed tests --- .../Verification/ProofOfAddress/proof-of-address-container.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/account/src/Sections/Verification/ProofOfAddress/proof-of-address-container.tsx b/packages/account/src/Sections/Verification/ProofOfAddress/proof-of-address-container.tsx index 4e2a29d7dc37..fe130b76660d 100644 --- a/packages/account/src/Sections/Verification/ProofOfAddress/proof-of-address-container.tsx +++ b/packages/account/src/Sections/Verification/ProofOfAddress/proof-of-address-container.tsx @@ -132,8 +132,7 @@ const ProofOfAddressContainer = observer(({ onSubmit }: TProofOfAddressContainer ); if (is_loading) return ; - if (!allow_document_upload || (!is_age_verified && !allow_poa_resubmission && document_status === 'none')) - return ; + if (!allow_document_upload) return ; if (has_submitted_poa && !poa_address_mismatch) return ; if ( From 7ac6b7312360eb2859c829919fa0122851757487 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CMatin-deriv=E2=80=9D?= Date: Wed, 17 Apr 2024 13:48:54 +0800 Subject: [PATCH 3/9] chore: removal of useAccountTransferVisible --- .../cashier/src/containers/cashier/cashier.tsx | 5 +---- .../Layout/Header/toggle-menu-drawer.jsx | 4 +--- packages/hooks/src/index.ts | 1 - packages/hooks/src/useAccountTransferVisible.ts | 14 -------------- 4 files changed, 2 insertions(+), 22 deletions(-) delete mode 100644 packages/hooks/src/useAccountTransferVisible.ts diff --git a/packages/cashier/src/containers/cashier/cashier.tsx b/packages/cashier/src/containers/cashier/cashier.tsx index 7cbf588b6ce5..73aff10db316 100644 --- a/packages/cashier/src/containers/cashier/cashier.tsx +++ b/packages/cashier/src/containers/cashier/cashier.tsx @@ -14,7 +14,6 @@ import { import { useAuthorize, useOnrampVisible, - useAccountTransferVisible, useIsP2PEnabled, usePaymentAgentTransferVisible, useP2PNotificationCount, @@ -72,7 +71,6 @@ const Cashier = observer(({ history, location, routes: routes_config }: TCashier const { is_from_derivgo } = common; const { is_cashier_visible: is_visible, is_mobile, toggleCashier, toggleReadyToDepositModal } = ui; const { currency, is_account_setting_loaded, is_logged_in, is_logging_in, is_svg, is_virtual } = client; - const is_account_transfer_visible = useAccountTransferVisible(); const is_onramp_visible = useOnrampVisible(); const p2p_notification_count = useP2PNotificationCount(); const { @@ -93,7 +91,7 @@ const Cashier = observer(({ history, location, routes: routes_config }: TCashier (route.path !== routes.cashier_pa_transfer || is_payment_agent_transfer_visible) && (route.path !== routes.cashier_p2p || is_p2p_enabled) && (route.path !== routes.cashier_onramp || is_onramp_visible) && - (route.path !== routes.cashier_acc_transfer || is_account_transfer_visible) + route.path !== routes.cashier_acc_transfer ) { options.push({ ...(route.path === routes.cashier_p2p && { count: p2p_notification_count }), @@ -113,7 +111,6 @@ const Cashier = observer(({ history, location, routes: routes_config }: TCashier return options; }, [ - is_account_transfer_visible, is_onramp_visible, is_p2p_enabled, is_payment_agent_transfer_visible, diff --git a/packages/core/src/App/Components/Layout/Header/toggle-menu-drawer.jsx b/packages/core/src/App/Components/Layout/Header/toggle-menu-drawer.jsx index b2dd8b0e9267..bfa75f3755a2 100644 --- a/packages/core/src/App/Components/Layout/Header/toggle-menu-drawer.jsx +++ b/packages/core/src/App/Components/Layout/Header/toggle-menu-drawer.jsx @@ -5,7 +5,6 @@ import { useRemoteConfig } from '@deriv/api'; import { Analytics } from '@deriv-com/analytics'; import { Div100vhContainer, Icon, MobileDrawer, ToggleSwitch } from '@deriv/components'; import { - useAccountTransferVisible, useAuthorize, useFeatureFlags, useIsP2PEnabled, @@ -57,7 +56,6 @@ const ToggleMenuDrawer = observer(({ platform_config }) => { const { payment_agent } = cashier; const { is_payment_agent_visible } = payment_agent; const { show_eu_related_content, setTogglePlatformType } = traders_hub; - const is_account_transfer_visible = useAccountTransferVisible(); const { isSuccess } = useAuthorize(); const is_onramp_visible = useOnrampVisible(); const { data: is_payment_agent_transfer_visible } = usePaymentAgentTransferVisible(); @@ -227,7 +225,7 @@ const ToggleMenuDrawer = observer(({ platform_config }) => { (route.path !== routes.cashier_pa_transfer || is_payment_agent_transfer_visible) && (route.path !== routes.cashier_p2p || is_p2p_enabled) && (route.path !== routes.cashier_onramp || is_onramp_visible) && - (route.path !== routes.cashier_acc_transfer || is_account_transfer_visible) + route.path !== routes.cashier_acc_transfer ) { return ( diff --git a/packages/hooks/src/index.ts b/packages/hooks/src/index.ts index 0b78032845dc..e15282409180 100644 --- a/packages/hooks/src/index.ts +++ b/packages/hooks/src/index.ts @@ -1,4 +1,3 @@ -export { default as useAccountTransferVisible } from './useAccountTransferVisible'; export { default as useActiveWallet } from './useActiveWallet'; export { default as useAuthorize } from './useAuthorize'; export { default as useAvailableWallets } from './useAvailableWallets'; diff --git a/packages/hooks/src/useAccountTransferVisible.ts b/packages/hooks/src/useAccountTransferVisible.ts deleted file mode 100644 index 43f433a2d309..000000000000 --- a/packages/hooks/src/useAccountTransferVisible.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { useStore } from '@deriv/stores'; -import useHasMaltaInvestAccount from './useHasMaltaInvestAccount'; - -const useAccountTransferVisible = () => { - const { client } = useStore(); - const { landing_company_shortcode, residence } = client; - const has_malta_invest_account = useHasMaltaInvestAccount(); - const is_account_transfer_visible = - residence !== 'im' && (landing_company_shortcode !== 'malta' || has_malta_invest_account); - - return is_account_transfer_visible; -}; - -export default useAccountTransferVisible; From dac8446a6d35910c45f81c0cd60bd6abb1511f05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CMatin-deriv=E2=80=9D?= Date: Wed, 17 Apr 2024 16:55:29 +0800 Subject: [PATCH 4/9] fix: test cases --- packages/cashier/src/containers/cashier/cashier.tsx | 3 +-- .../src/App/Components/Layout/Header/toggle-menu-drawer.jsx | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/cashier/src/containers/cashier/cashier.tsx b/packages/cashier/src/containers/cashier/cashier.tsx index 73aff10db316..a1881f22dd6a 100644 --- a/packages/cashier/src/containers/cashier/cashier.tsx +++ b/packages/cashier/src/containers/cashier/cashier.tsx @@ -90,8 +90,7 @@ const Cashier = observer(({ history, location, routes: routes_config }: TCashier (route.path !== routes.cashier_pa || is_payment_agent_visible) && (route.path !== routes.cashier_pa_transfer || is_payment_agent_transfer_visible) && (route.path !== routes.cashier_p2p || is_p2p_enabled) && - (route.path !== routes.cashier_onramp || is_onramp_visible) && - route.path !== routes.cashier_acc_transfer + (route.path !== routes.cashier_onramp || is_onramp_visible) ) { options.push({ ...(route.path === routes.cashier_p2p && { count: p2p_notification_count }), diff --git a/packages/core/src/App/Components/Layout/Header/toggle-menu-drawer.jsx b/packages/core/src/App/Components/Layout/Header/toggle-menu-drawer.jsx index bfa75f3755a2..8d0a6ca4af59 100644 --- a/packages/core/src/App/Components/Layout/Header/toggle-menu-drawer.jsx +++ b/packages/core/src/App/Components/Layout/Header/toggle-menu-drawer.jsx @@ -224,8 +224,7 @@ const ToggleMenuDrawer = observer(({ platform_config }) => { (route.path !== routes.cashier_pa || is_payment_agent_visible) && (route.path !== routes.cashier_pa_transfer || is_payment_agent_transfer_visible) && (route.path !== routes.cashier_p2p || is_p2p_enabled) && - (route.path !== routes.cashier_onramp || is_onramp_visible) && - route.path !== routes.cashier_acc_transfer + (route.path !== routes.cashier_onramp || is_onramp_visible) ) { return ( From ea9a044e8217b911f026a3bf789374d18d9de840 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CMatin-deriv=E2=80=9D?= Date: Thu, 18 Apr 2024 11:17:52 +0800 Subject: [PATCH 5/9] chore: revert back some changes --- .../cashier/src/containers/cashier/cashier.tsx | 6 +++++- .../Layout/Header/toggle-menu-drawer.jsx | 5 ++++- packages/hooks/src/index.ts | 1 + packages/hooks/src/useAccountTransferVisible.ts | 14 ++++++++++++++ 4 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 packages/hooks/src/useAccountTransferVisible.ts diff --git a/packages/cashier/src/containers/cashier/cashier.tsx b/packages/cashier/src/containers/cashier/cashier.tsx index a1881f22dd6a..7cbf588b6ce5 100644 --- a/packages/cashier/src/containers/cashier/cashier.tsx +++ b/packages/cashier/src/containers/cashier/cashier.tsx @@ -14,6 +14,7 @@ import { import { useAuthorize, useOnrampVisible, + useAccountTransferVisible, useIsP2PEnabled, usePaymentAgentTransferVisible, useP2PNotificationCount, @@ -71,6 +72,7 @@ const Cashier = observer(({ history, location, routes: routes_config }: TCashier const { is_from_derivgo } = common; const { is_cashier_visible: is_visible, is_mobile, toggleCashier, toggleReadyToDepositModal } = ui; const { currency, is_account_setting_loaded, is_logged_in, is_logging_in, is_svg, is_virtual } = client; + const is_account_transfer_visible = useAccountTransferVisible(); const is_onramp_visible = useOnrampVisible(); const p2p_notification_count = useP2PNotificationCount(); const { @@ -90,7 +92,8 @@ const Cashier = observer(({ history, location, routes: routes_config }: TCashier (route.path !== routes.cashier_pa || is_payment_agent_visible) && (route.path !== routes.cashier_pa_transfer || is_payment_agent_transfer_visible) && (route.path !== routes.cashier_p2p || is_p2p_enabled) && - (route.path !== routes.cashier_onramp || is_onramp_visible) + (route.path !== routes.cashier_onramp || is_onramp_visible) && + (route.path !== routes.cashier_acc_transfer || is_account_transfer_visible) ) { options.push({ ...(route.path === routes.cashier_p2p && { count: p2p_notification_count }), @@ -110,6 +113,7 @@ const Cashier = observer(({ history, location, routes: routes_config }: TCashier return options; }, [ + is_account_transfer_visible, is_onramp_visible, is_p2p_enabled, is_payment_agent_transfer_visible, diff --git a/packages/core/src/App/Components/Layout/Header/toggle-menu-drawer.jsx b/packages/core/src/App/Components/Layout/Header/toggle-menu-drawer.jsx index 8d0a6ca4af59..b2dd8b0e9267 100644 --- a/packages/core/src/App/Components/Layout/Header/toggle-menu-drawer.jsx +++ b/packages/core/src/App/Components/Layout/Header/toggle-menu-drawer.jsx @@ -5,6 +5,7 @@ import { useRemoteConfig } from '@deriv/api'; import { Analytics } from '@deriv-com/analytics'; import { Div100vhContainer, Icon, MobileDrawer, ToggleSwitch } from '@deriv/components'; import { + useAccountTransferVisible, useAuthorize, useFeatureFlags, useIsP2PEnabled, @@ -56,6 +57,7 @@ const ToggleMenuDrawer = observer(({ platform_config }) => { const { payment_agent } = cashier; const { is_payment_agent_visible } = payment_agent; const { show_eu_related_content, setTogglePlatformType } = traders_hub; + const is_account_transfer_visible = useAccountTransferVisible(); const { isSuccess } = useAuthorize(); const is_onramp_visible = useOnrampVisible(); const { data: is_payment_agent_transfer_visible } = usePaymentAgentTransferVisible(); @@ -224,7 +226,8 @@ const ToggleMenuDrawer = observer(({ platform_config }) => { (route.path !== routes.cashier_pa || is_payment_agent_visible) && (route.path !== routes.cashier_pa_transfer || is_payment_agent_transfer_visible) && (route.path !== routes.cashier_p2p || is_p2p_enabled) && - (route.path !== routes.cashier_onramp || is_onramp_visible) + (route.path !== routes.cashier_onramp || is_onramp_visible) && + (route.path !== routes.cashier_acc_transfer || is_account_transfer_visible) ) { return ( diff --git a/packages/hooks/src/index.ts b/packages/hooks/src/index.ts index e15282409180..0b78032845dc 100644 --- a/packages/hooks/src/index.ts +++ b/packages/hooks/src/index.ts @@ -1,3 +1,4 @@ +export { default as useAccountTransferVisible } from './useAccountTransferVisible'; export { default as useActiveWallet } from './useActiveWallet'; export { default as useAuthorize } from './useAuthorize'; export { default as useAvailableWallets } from './useAvailableWallets'; diff --git a/packages/hooks/src/useAccountTransferVisible.ts b/packages/hooks/src/useAccountTransferVisible.ts new file mode 100644 index 000000000000..43f433a2d309 --- /dev/null +++ b/packages/hooks/src/useAccountTransferVisible.ts @@ -0,0 +1,14 @@ +import { useStore } from '@deriv/stores'; +import useHasMaltaInvestAccount from './useHasMaltaInvestAccount'; + +const useAccountTransferVisible = () => { + const { client } = useStore(); + const { landing_company_shortcode, residence } = client; + const has_malta_invest_account = useHasMaltaInvestAccount(); + const is_account_transfer_visible = + residence !== 'im' && (landing_company_shortcode !== 'malta' || has_malta_invest_account); + + return is_account_transfer_visible; +}; + +export default useAccountTransferVisible; From c057345603f69e79ffcf9466b58292d298be18be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CMatin-deriv=E2=80=9D?= Date: Thu, 18 Apr 2024 14:07:21 +0800 Subject: [PATCH 6/9] chore: review comments --- packages/core/src/Stores/client-store.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/core/src/Stores/client-store.js b/packages/core/src/Stores/client-store.js index 4a1e9f0c81e9..4191fbfdce46 100644 --- a/packages/core/src/Stores/client-store.js +++ b/packages/core/src/Stores/client-store.js @@ -48,8 +48,8 @@ import { getRegion, isEuCountry, isMultipliersOnly, isOptionsBlocked } from '_co const LANGUAGE_KEY = 'i18n_language'; const storage_key = 'client.accounts'; const store_name = 'client_store'; -const eu_shortcode_regex = new RegExp('^maltainvest$'); -const eu_excluded_regex = new RegExp('^mt$'); +const eu_shortcode_regex = /^maltainvest$/; +const eu_excluded_regex = /^mt$/; export default class ClientStore extends BaseStore { loginid; From 3fb8c943c96b7a1d2aeb6ca7178243aa32dc0477 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CMatin-deriv=E2=80=9D?= Date: Tue, 23 Apr 2024 10:50:46 +0800 Subject: [PATCH 7/9] chore: Remove country-level business logic --- .../Header/__tests__/account-info.spec.tsx | 11 ---------- .../__tests__/display-account-type.spec.tsx | 14 +------------ .../Layout/Header/account-actions.jsx | 4 ---- .../Components/Layout/Header/account-info.jsx | 8 +------ .../Layout/Header/display-account-type.tsx | 11 ++-------- .../__tests__/account-switcher.spec.jsx | 1 - .../account-switcher-account-list.jsx | 17 ++++----------- .../AccountSwitcher/account-switcher.jsx | 4 ---- .../Layout/header/default-header-wallets.tsx | 2 -- .../Layout/header/header-account-actions.tsx | 3 +-- .../header/traders-hub-header-wallets.tsx | 15 ++----------- .../Layout/header/traders-hub-header.tsx | 15 ++----------- .../__tests__/real-account-signup.spec.jsx | 1 - .../RealAccountSignup/helpers/constants.js | 5 ++--- .../RealAccountSignup/real-account-signup.jsx | 13 ++---------- .../status-dialog-container.jsx | 2 -- packages/core/src/Stores/client-store.js | 21 ------------------- packages/stores/src/mockStore.ts | 7 ------- packages/stores/types.ts | 8 ------- 19 files changed, 17 insertions(+), 145 deletions(-) diff --git a/packages/core/src/App/Components/Layout/Header/__tests__/account-info.spec.tsx b/packages/core/src/App/Components/Layout/Header/__tests__/account-info.spec.tsx index 7cc8d598531c..9d5c1777bda9 100644 --- a/packages/core/src/App/Components/Layout/Header/__tests__/account-info.spec.tsx +++ b/packages/core/src/App/Components/Layout/Header/__tests__/account-info.spec.tsx @@ -82,15 +82,4 @@ describe('AccountInfo component', () => { expect(text).toBeInTheDocument(); expect(screen.queryByText(/no currency assigned/i)).not.toBeInTheDocument(); }); - - it('should render proper "AccountType" base on the passed properties', () => { - const { rerender } = render(); - expect(screen.getByText(/multipliers/i)).toBeInTheDocument(); - - rerender(); - expect(screen.getByText(/gaming/i)).toBeInTheDocument(); - - rerender(); - expect(screen.getByText(/options/i)).toBeInTheDocument(); - }); }); diff --git a/packages/core/src/App/Components/Layout/Header/__tests__/display-account-type.spec.tsx b/packages/core/src/App/Components/Layout/Header/__tests__/display-account-type.spec.tsx index 400ca09be537..e0ecb13b0caf 100644 --- a/packages/core/src/App/Components/Layout/Header/__tests__/display-account-type.spec.tsx +++ b/packages/core/src/App/Components/Layout/Header/__tests__/display-account-type.spec.tsx @@ -4,19 +4,7 @@ import DisplayAccountType from '../display-account-type'; describe('DisplayAccountType component', () => { it('should render "Multipliers"', () => { - render(); + render(); expect(screen.getByText(/multipliers/i)).toBeInTheDocument(); }); - - it('should render "Gaming" if is_united_kingdom = true', () => { - render( - - ); - expect(screen.getByText(/gaming/i)).toBeInTheDocument(); - }); - - it('should render "Options" for Belgium', () => { - render(); - expect(screen.getByText(/options/i)).toBeInTheDocument(); - }); }); diff --git a/packages/core/src/App/Components/Layout/Header/account-actions.jsx b/packages/core/src/App/Components/Layout/Header/account-actions.jsx index e8627d2c32ee..8d6f2b4d35f8 100644 --- a/packages/core/src/App/Components/Layout/Header/account-actions.jsx +++ b/packages/core/src/App/Components/Layout/Header/account-actions.jsx @@ -23,7 +23,6 @@ const AccountActions = React.memo( account_type, balance, currency, - country_standpoint, disableApp, enableApp, is_acc_switcher_on, @@ -63,7 +62,6 @@ const AccountActions = React.memo( is_virtual={is_virtual} is_mobile currency={currency} - country_standpoint={country_standpoint} is_dialog_on={is_acc_switcher_on} toggleDialog={toggleAccountsDialog} /> @@ -99,7 +97,6 @@ const AccountActions = React.memo( is_eu={is_eu} is_virtual={is_virtual} currency={currency} - country_standpoint={country_standpoint} is_dialog_on={is_acc_switcher_on} toggleDialog={toggleAccountsDialog} /> @@ -148,7 +145,6 @@ AccountActions.propTypes = { is_eu: PropTypes.bool, disableApp: PropTypes.any, enableApp: PropTypes.any, - country_standpoint: PropTypes.object, is_acc_switcher_on: PropTypes.any, is_logged_in: PropTypes.any, is_notifications_visible: PropTypes.any, diff --git a/packages/core/src/App/Components/Layout/Header/account-info.jsx b/packages/core/src/App/Components/Layout/Header/account-info.jsx index b86626987319..5917aad57379 100644 --- a/packages/core/src/App/Components/Layout/Header/account-info.jsx +++ b/packages/core/src/App/Components/Layout/Header/account-info.jsx @@ -16,7 +16,6 @@ const AccountInfo = ({ account_type = '', balance, currency, - country_standpoint, disableApp, enableApp, is_dialog_on, @@ -71,11 +70,7 @@ const AccountInfo = ({ )}

- + )} @@ -123,7 +118,6 @@ AccountInfo.propTypes = { account_type: PropTypes.string, balance: PropTypes.string, currency: PropTypes.string, - country_standpoint: PropTypes.object, disableApp: PropTypes.func, enableApp: PropTypes.func, is_dialog_on: PropTypes.bool, diff --git a/packages/core/src/App/Components/Layout/Header/display-account-type.tsx b/packages/core/src/App/Components/Layout/Header/display-account-type.tsx index bfbf5302f114..aa59c953888b 100644 --- a/packages/core/src/App/Components/Layout/Header/display-account-type.tsx +++ b/packages/core/src/App/Components/Layout/Header/display-account-type.tsx @@ -3,21 +3,14 @@ import { Localize } from '@deriv/translations'; type TDisplayAccountType = { account_type: string; - country_standpoint: { - is_united_kingdom?: boolean; - is_belgium?: boolean; - }; is_eu: boolean; }; -const DisplayAccountType = ({ account_type, country_standpoint, is_eu }: TDisplayAccountType) => { +const DisplayAccountType = ({ account_type, is_eu }: TDisplayAccountType) => { if (account_type === 'financial') { return ; } else if (account_type === 'gaming') { - if (country_standpoint.is_united_kingdom) { - return ; - } - if (is_eu || country_standpoint.is_belgium) { + if (is_eu) { return ; } return ; diff --git a/packages/core/src/App/Containers/AccountSwitcher/__tests__/account-switcher.spec.jsx b/packages/core/src/App/Containers/AccountSwitcher/__tests__/account-switcher.spec.jsx index a1a262c1bada..f73af634daf7 100644 --- a/packages/core/src/App/Containers/AccountSwitcher/__tests__/account-switcher.spec.jsx +++ b/packages/core/src/App/Containers/AccountSwitcher/__tests__/account-switcher.spec.jsx @@ -104,7 +104,6 @@ let store = mockStore({ }, ], residence: 'id', - country_standpoint: { is_united_kingdom: true }, is_eu: false, is_landing_company_loaded: true, is_low_risk: true, diff --git a/packages/core/src/App/Containers/AccountSwitcher/account-switcher-account-list.jsx b/packages/core/src/App/Containers/AccountSwitcher/account-switcher-account-list.jsx index eacbde35f98e..26db737bd2c9 100644 --- a/packages/core/src/App/Containers/AccountSwitcher/account-switcher-account-list.jsx +++ b/packages/core/src/App/Containers/AccountSwitcher/account-switcher-account-list.jsx @@ -8,7 +8,6 @@ const AccountList = ({ balance, currency, currency_icon, - country_standpoint, display_type, has_balance, has_error, @@ -49,12 +48,7 @@ const AccountList = ({ /> {display_type === 'currency' ? ( - + ) : ( { - const user_is_from_this_country_list = Object.values(country_standpoint).includes(true); +const CurrencyDisplay = ({ currency, loginid, is_virtual }) => { const account_type = loginid.replace(/\d/g, ''); - if (user_is_from_this_country_list) { - if (account_type === 'MF') { - return ; - } + if (account_type === 'MF') { + return ; } if (is_virtual) { diff --git a/packages/core/src/App/Containers/AccountSwitcher/account-switcher.jsx b/packages/core/src/App/Containers/AccountSwitcher/account-switcher.jsx index c8a4d62cab89..6acf2c7dbb7e 100644 --- a/packages/core/src/App/Containers/AccountSwitcher/account-switcher.jsx +++ b/packages/core/src/App/Containers/AccountSwitcher/account-switcher.jsx @@ -33,7 +33,6 @@ const AccountSwitcher = observer(({ history, is_mobile, is_visible }) => { accounts, account_type, account_list, - country_standpoint, currency, is_eu, is_landing_company_loaded, @@ -222,7 +221,6 @@ const AccountSwitcher = observer(({ history, is_mobile, is_visible }) => { balance={accounts[account.loginid].balance} currency={accounts[account.loginid].currency} currency_icon={`IcCurrency-${account.icon}`} - country_standpoint={country_standpoint} display_type={'currency'} has_balance={'balance' in accounts[account.loginid]} has_reset_balance={canResetBalance(accounts[account_loginid])} @@ -269,7 +267,6 @@ const AccountSwitcher = observer(({ history, is_mobile, is_visible }) => { balance={accounts[account.loginid].balance} currency={accounts[account.loginid].currency} currency_icon={`IcCurrency-${account.icon}`} - country_standpoint={country_standpoint} display_type={'currency'} has_balance={'balance' in accounts[account.loginid]} is_disabled={account.is_disabled} @@ -341,7 +338,6 @@ const AccountSwitcher = observer(({ history, is_mobile, is_visible }) => { balance={accounts[account.loginid].balance} currency={accounts[account.loginid].currency} currency_icon={`IcCurrency-${account.icon}`} - country_standpoint={country_standpoint} display_type={'currency'} has_balance={'balance' in accounts[account.loginid]} is_disabled={account.is_disabled} diff --git a/packages/core/src/App/Containers/Layout/header/default-header-wallets.tsx b/packages/core/src/App/Containers/Layout/header/default-header-wallets.tsx index e16b5f05d247..e74e79e01768 100644 --- a/packages/core/src/App/Containers/Layout/header/default-header-wallets.tsx +++ b/packages/core/src/App/Containers/Layout/header/default-header-wallets.tsx @@ -33,7 +33,6 @@ const DefaultHeaderWallets = () => { account_type, balance, currency, - country_standpoint, is_bot_allowed, is_eu, is_logged_in, @@ -144,7 +143,6 @@ const DefaultHeaderWallets = () => { account_type={account_type} balance={balance} currency={currency} - country_standpoint={country_standpoint} disableApp={disableApp} enableApp={enableApp} is_acc_switcher_on={is_acc_switcher_on} diff --git a/packages/core/src/App/Containers/Layout/header/header-account-actions.tsx b/packages/core/src/App/Containers/Layout/header/header-account-actions.tsx index 1cf53166ba7e..54e06534579b 100644 --- a/packages/core/src/App/Containers/Layout/header/header-account-actions.tsx +++ b/packages/core/src/App/Containers/Layout/header/header-account-actions.tsx @@ -8,7 +8,7 @@ type THeaderAccountActions = { const HeaderAccountActions = observer(({ onClickDeposit }: THeaderAccountActions) => { const { client, ui, notifications } = useStore(); - const { account_type, balance, currency, country_standpoint, is_eu, is_logged_in, is_virtual } = client; + const { account_type, balance, currency, is_eu, is_logged_in, is_virtual } = client; const { account_switcher_disabled_message, disableApp, @@ -27,7 +27,6 @@ const HeaderAccountActions = observer(({ onClickDeposit }: THeaderAccountActions account_type={account_type} balance={balance} currency={currency} - country_standpoint={country_standpoint} disableApp={disableApp} enableApp={enableApp} is_acc_switcher_on={is_accounts_switcher_on} diff --git a/packages/core/src/App/Containers/Layout/header/traders-hub-header-wallets.tsx b/packages/core/src/App/Containers/Layout/header/traders-hub-header-wallets.tsx index 7faf9a093070..856621f73975 100644 --- a/packages/core/src/App/Containers/Layout/header/traders-hub-header-wallets.tsx +++ b/packages/core/src/App/Containers/Layout/header/traders-hub-header-wallets.tsx @@ -25,17 +25,8 @@ type TPlatforms = typeof platforms; const TradersHubHeaderWallets = observer(() => { const { client, common, traders_hub, ui } = useStore(); - const { - account_type, - balance, - country_standpoint, - currency, - has_any_real_account, - is_eu, - is_logged_in, - is_mt5_allowed, - is_virtual, - } = client; + const { account_type, balance, currency, has_any_real_account, is_eu, is_logged_in, is_mt5_allowed, is_virtual } = + client; const { platform } = common; const { modal_data } = traders_hub; const { @@ -139,7 +130,6 @@ const TradersHubHeaderWallets = observer(() => { acc_switcher_disabled_message={account_switcher_disabled_message} account_type={account_type} balance={account_balance} - country_standpoint={country_standpoint} currency={currency} is_dialog_on={is_accounts_switcher_on} is_disabled={false} @@ -166,7 +156,6 @@ const TradersHubHeaderWallets = observer(() => { acc_switcher_disabled_message={account_switcher_disabled_message} account_type={account_type} balance={account_balance} - country_standpoint={country_standpoint} currency={currency} is_dialog_on={is_accounts_switcher_on} is_disabled={false} diff --git a/packages/core/src/App/Containers/Layout/header/traders-hub-header.tsx b/packages/core/src/App/Containers/Layout/header/traders-hub-header.tsx index 9bcefbc41853..97d818ff56db 100644 --- a/packages/core/src/App/Containers/Layout/header/traders-hub-header.tsx +++ b/packages/core/src/App/Containers/Layout/header/traders-hub-header.tsx @@ -25,17 +25,8 @@ type TPlatforms = typeof platforms; const TradersHubHeader = observer(() => { const { client, common, traders_hub, ui } = useStore(); - const { - account_type, - balance, - country_standpoint, - currency, - has_any_real_account, - is_eu, - is_logged_in, - is_mt5_allowed, - is_virtual, - } = client; + const { account_type, balance, currency, has_any_real_account, is_eu, is_logged_in, is_mt5_allowed, is_virtual } = + client; const { platform } = common; const { modal_data } = traders_hub; const { @@ -140,7 +131,6 @@ const TradersHubHeader = observer(() => { acc_switcher_disabled_message={account_switcher_disabled_message} account_type={account_type} balance={account_balance} - country_standpoint={country_standpoint} currency={currency} is_dialog_on={is_accounts_switcher_on} is_disabled={false} @@ -169,7 +159,6 @@ const TradersHubHeader = observer(() => { acc_switcher_disabled_message={account_switcher_disabled_message} account_type={account_type} balance={account_balance} - country_standpoint={country_standpoint} currency={currency} is_dialog_on={is_accounts_switcher_on} is_disabled={false} diff --git a/packages/core/src/App/Containers/RealAccountSignup/__tests__/real-account-signup.spec.jsx b/packages/core/src/App/Containers/RealAccountSignup/__tests__/real-account-signup.spec.jsx index b9db4cfe46e8..f978f2a38847 100644 --- a/packages/core/src/App/Containers/RealAccountSignup/__tests__/real-account-signup.spec.jsx +++ b/packages/core/src/App/Containers/RealAccountSignup/__tests__/real-account-signup.spec.jsx @@ -39,7 +39,6 @@ describe('', () => { const store = mockStore({ client: { available_crypto_currencies: [], - country_standpoint: '', currency: 'USD', fetchAccountSettings: jest.fn(), residence: 'gb', diff --git a/packages/core/src/App/Containers/RealAccountSignup/helpers/constants.js b/packages/core/src/App/Containers/RealAccountSignup/helpers/constants.js index 846a4d1747ce..e1eaacc38d23 100644 --- a/packages/core/src/App/Containers/RealAccountSignup/helpers/constants.js +++ b/packages/core/src/App/Containers/RealAccountSignup/helpers/constants.js @@ -37,14 +37,13 @@ export const getAccountTitle = landing_company_shortcode => { /** * @param {string} landing_company_shortcode - * @param {boolean} is_belgium_residence, * * @return {EXPERIAN.WARN|EXPERIAN.SUCCESS|EXPERIAN.DANGER} */ export const getExperianResult = status => { - const { landing_company_shortcode = '', is_belgium_residence = false } = status; + const { landing_company_shortcode = '' } = status; - if (landing_company_shortcode === 'svg' || is_belgium_residence) return EXPERIAN.SUCCESS; + if (landing_company_shortcode === 'svg') return EXPERIAN.SUCCESS; return EXPERIAN.SUCCESS; }; diff --git a/packages/core/src/App/Containers/RealAccountSignup/real-account-signup.jsx b/packages/core/src/App/Containers/RealAccountSignup/real-account-signup.jsx index 5d8b8d40de10..2510c575dc2a 100644 --- a/packages/core/src/App/Containers/RealAccountSignup/real-account-signup.jsx +++ b/packages/core/src/App/Containers/RealAccountSignup/real-account-signup.jsx @@ -39,7 +39,7 @@ const modal_pages_indices = { }; let active_modal_index_no = 0; -const WizardHeading = ({ country_standpoint, currency, real_account_signup_target }) => { +const WizardHeading = ({ currency, real_account_signup_target }) => { const maltainvest_signup = real_account_signup_target === 'maltainvest'; const deposit_cash_signup = real_account_signup_target === 'deposit_cash'; @@ -53,10 +53,7 @@ const WizardHeading = ({ country_standpoint, currency, real_account_signup_targe switch (real_account_signup_target) { case 'maltainvest': - if (country_standpoint.is_france || country_standpoint.is_other_eu || country_standpoint.is_rest_of_eu) { - return ; - } - return ; + return ; default: return ; } @@ -66,7 +63,6 @@ const RealAccountSignup = observer(({ history, state_index, is_trading_experienc const { ui, client, traders_hub, modules } = useStore(); const { available_crypto_currencies, - country_standpoint, currency, fetchAccountSettings, has_fiat, @@ -95,7 +91,6 @@ const RealAccountSignup = observer(({ history, state_index, is_trading_experienc const deposit_target = modules.cashier.general_store.deposit_target; const setIsDeposit = modules.cashier.general_store.setIsDeposit; const should_show_all_available_currencies = modules.cashier.general_store.should_show_all_available_currencies; - const is_belgium_residence = client.residence === 'be'; // TODO: [deriv-eu] refactor this once more residence checks are required const [current_action, setCurrentAction] = React.useState(null); const [is_loading, setIsLoading] = React.useState(false); const [error, setError] = React.useState(null); @@ -631,10 +626,8 @@ const RealAccountSignup = observer(({ history, state_index, is_trading_experienc return ( diff --git a/packages/core/src/App/Containers/RealAccountSignup/status-dialog-container.jsx b/packages/core/src/App/Containers/RealAccountSignup/status-dialog-container.jsx index 4bd6580de455..ebd9127fefdd 100644 --- a/packages/core/src/App/Containers/RealAccountSignup/status-dialog-container.jsx +++ b/packages/core/src/App/Containers/RealAccountSignup/status-dialog-container.jsx @@ -23,7 +23,6 @@ const CloseIcon = ({ closeModal }) => ( const StatusDialogContainer = observer(({ closeModal, currency, history, icon_size }) => { const { client } = useStore(); const { landing_company_shortcode, is_fully_authenticated } = client; - const is_belgium_residence = client.residence === 'be'; // TODO: [deriv-eu] refactor this once more residence checks are required const closeModalAndOpenCashier = () => { closeModal(); history.push(routes.cashier_deposit); @@ -48,7 +47,6 @@ const StatusDialogContainer = observer(({ closeModal, currency, history, icon_si const getStatus = () => getExperianResult({ landing_company_shortcode, - is_belgium_residence, }); return ( diff --git a/packages/core/src/Stores/client-store.js b/packages/core/src/Stores/client-store.js index 4191fbfdce46..90aba42ba69d 100644 --- a/packages/core/src/Stores/client-store.js +++ b/packages/core/src/Stores/client-store.js @@ -299,7 +299,6 @@ export default class ClientStore extends BaseStore { is_eu: computed, is_uk: computed, is_brazil: computed, - country_standpoint: computed, can_upgrade: computed, can_upgrade_to: computed, virtual_account_loginid: computed, @@ -881,26 +880,6 @@ export default class ClientStore extends BaseStore { return this.residence === 'gb'; } - get country_standpoint() { - const result = { - is_united_kingdom: this.is_uk, - is_france: this.residence === 'fr', - is_belgium: this.residence === 'be', - // Other EU countries: Germany, Spain, Italy, Luxembourg and Greece - is_other_eu: - this.residence === 'de' || - this.residence === 'es' || - this.residence === 'it' || - this.residence === 'lu' || - this.residence === 'gr', - }; - - result.is_rest_of_eu = - this.is_eu && !result.is_uk && !result.is_france && !result.is_belgium && !result.is_other_eu; - - return result; - } - get can_upgrade() { return this.upgrade_info && (this.upgrade_info.can_upgrade || this.upgrade_info.can_open_multi); } diff --git a/packages/stores/src/mockStore.ts b/packages/stores/src/mockStore.ts index 5215a5ab4b75..c53131dd8bfa 100644 --- a/packages/stores/src/mockStore.ts +++ b/packages/stores/src/mockStore.ts @@ -112,13 +112,6 @@ const mock = (): TStores & { is_mock: boolean } => { balance: '', can_change_fiat_currency: false, clients_country: '', - country_standpoint: { - is_belgium: false, - is_france: false, - is_other_eu: false, - is_rest_of_eu: false, - is_united_kingdom: false, - }, currency: '', currencies_list: [{ text: '', value: '', has_tool_tip: false }], current_currency_type: '', diff --git a/packages/stores/types.ts b/packages/stores/types.ts index b2d8620d7f26..64abfe6f33ed 100644 --- a/packages/stores/types.ts +++ b/packages/stores/types.ts @@ -395,13 +395,6 @@ type RealAccountSignupSettings = { previous_currency: string; success_message: string; }; -type TCountryStandpoint = { - is_belgium: boolean; - is_france: boolean; - is_other_eu: boolean; - is_rest_of_eu: boolean; - is_united_kingdom: boolean; -}; type TClientStore = { fetchStatesList: () => Promise<StatesList>; @@ -426,7 +419,6 @@ type TClientStore = { clients_country: string; cfd_score: number; setCFDScore: (score: number) => void; - country_standpoint: TCountryStandpoint; currency: string; ctrader_total_balance: number; currencies_list: { text: string; value: string; has_tool_tip?: boolean }[]; From 9fdde3dc1dd29974f7e5113c51bca7aa722b68e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CMatin-deriv=E2=80=9D?= <matin@deriv.com> Date: Mon, 6 May 2024 13:47:20 +0800 Subject: [PATCH 8/9] chore: remove is_uk flag --- .../__tests__/self-exclusion-article.spec.tsx | 2 -- .../self-exclusion-confirm-page.spec.tsx | 2 -- .../self-exclusion-article-content.tsx | 9 +++---- .../self-exclusion/self-exclusion-context.tsx | 1 - .../__tests__/self-exclusion.spec.tsx | 1 - .../Security/SelfExclusion/self-exclusion.tsx | 3 +-- .../Components/complaints-policy-content.jsx | 26 +++---------------- packages/core/src/Stores/client-store.js | 5 ---- packages/stores/src/mockStore.ts | 1 - packages/stores/types.ts | 1 - 10 files changed, 7 insertions(+), 44 deletions(-) diff --git a/packages/account/src/Components/self-exclusion/__tests__/self-exclusion-article.spec.tsx b/packages/account/src/Components/self-exclusion/__tests__/self-exclusion-article.spec.tsx index ad68ca185397..faf26f0039dc 100644 --- a/packages/account/src/Components/self-exclusion/__tests__/self-exclusion-article.spec.tsx +++ b/packages/account/src/Components/self-exclusion/__tests__/self-exclusion-article.spec.tsx @@ -19,7 +19,6 @@ describe('<SelfExclusionArticle />', () => { let mock_self_exclusion_context = { is_app_settings: false, is_eu: false, - is_uk: false, currency: '', overlay_ref: document.createElement('div'), toggleArticle: jest.fn(), @@ -39,7 +38,6 @@ describe('<SelfExclusionArticle />', () => { mock_self_exclusion_context = { is_app_settings: false, is_eu: false, - is_uk: false, currency: '', overlay_ref: document.createElement('div'), toggleArticle: jest.fn(), diff --git a/packages/account/src/Components/self-exclusion/__tests__/self-exclusion-confirm-page.spec.tsx b/packages/account/src/Components/self-exclusion/__tests__/self-exclusion-confirm-page.spec.tsx index bce7ac4898fd..a0a5ebc764d9 100644 --- a/packages/account/src/Components/self-exclusion/__tests__/self-exclusion-confirm-page.spec.tsx +++ b/packages/account/src/Components/self-exclusion/__tests__/self-exclusion-confirm-page.spec.tsx @@ -28,7 +28,6 @@ describe('<SelfExclusionConfirmPage />', () => { is_app_settings: false, is_wrapper_bypassed: false, toggleArticle: jest.fn(), - is_uk: false, handleSubmit: jest.fn(), validateFields: jest.fn(), }; @@ -49,7 +48,6 @@ describe('<SelfExclusionConfirmPage />', () => { is_app_settings: false, is_wrapper_bypassed: false, toggleArticle: jest.fn(), - is_uk: false, handleSubmit: jest.fn(), validateFields: jest.fn(), }; diff --git a/packages/account/src/Components/self-exclusion/self-exclusion-article-content.tsx b/packages/account/src/Components/self-exclusion/self-exclusion-article-content.tsx index 6e0709bf219a..b60b72c012e0 100644 --- a/packages/account/src/Components/self-exclusion/self-exclusion-article-content.tsx +++ b/packages/account/src/Components/self-exclusion/self-exclusion-article-content.tsx @@ -6,10 +6,7 @@ import { Localize, localize } from '@deriv/translations'; import { Button, Icon, OpenLiveChatLink, Popup, Text } from '@deriv/components'; import SelfExclusionContext from './self-exclusion-context'; -type TSelfExclusionArticleItems = Record< - 'is_eu' | 'is_uk' | 'is_deriv_crypto' | 'is_app_settings', - boolean | undefined ->; +type TSelfExclusionArticleItems = Record<'is_eu' | 'is_deriv_crypto' | 'is_app_settings', boolean | undefined>; type TSelfExclusionArticleContent = { is_in_overlay: boolean; @@ -123,10 +120,10 @@ export const selfExclusionArticleItems = ({ is_eu, is_deriv_crypto, is_app_setti }; const SelfExclusionArticleContent = ({ is_in_overlay }: Partial<TSelfExclusionArticleContent>) => { - const { is_app_settings, toggleArticle, overlay_ref, is_eu, is_uk } = React.useContext(SelfExclusionContext); + const { is_app_settings, toggleArticle, overlay_ref, is_eu } = React.useContext(SelfExclusionContext); const { is_deriv_crypto } = React.useContext(PlatformContext); - const keyed_article_items = selfExclusionArticleItems({ is_eu, is_uk, is_deriv_crypto, is_app_settings }); + const keyed_article_items = selfExclusionArticleItems({ is_eu, is_deriv_crypto, is_app_settings }); if (is_in_overlay) { return ( <Popup.Overlay diff --git a/packages/account/src/Components/self-exclusion/self-exclusion-context.tsx b/packages/account/src/Components/self-exclusion/self-exclusion-context.tsx index 01858fc987bb..da0e7daa0aa7 100644 --- a/packages/account/src/Components/self-exclusion/self-exclusion-context.tsx +++ b/packages/account/src/Components/self-exclusion/self-exclusion-context.tsx @@ -13,7 +13,6 @@ export type TSelfExclusionContext = { is_appstore?: boolean; is_app_settings?: boolean; is_eu?: boolean; - is_uk?: boolean; is_mf?: boolean; is_tablet?: boolean; is_wrapper_bypassed?: boolean; diff --git a/packages/account/src/Sections/Security/SelfExclusion/__tests__/self-exclusion.spec.tsx b/packages/account/src/Sections/Security/SelfExclusion/__tests__/self-exclusion.spec.tsx index 6fa145c391d6..d6879be8be81 100644 --- a/packages/account/src/Sections/Security/SelfExclusion/__tests__/self-exclusion.spec.tsx +++ b/packages/account/src/Sections/Security/SelfExclusion/__tests__/self-exclusion.spec.tsx @@ -49,7 +49,6 @@ const mock = { standpoint: { svg: false, }, - is_uk: false, is_virtual: false, is_switching: false, landing_company_shortcode: '', diff --git a/packages/account/src/Sections/Security/SelfExclusion/self-exclusion.tsx b/packages/account/src/Sections/Security/SelfExclusion/self-exclusion.tsx index 2b9f0fa1ae5f..07bdb15dd6e9 100644 --- a/packages/account/src/Sections/Security/SelfExclusion/self-exclusion.tsx +++ b/packages/account/src/Sections/Security/SelfExclusion/self-exclusion.tsx @@ -71,7 +71,7 @@ type TResponse = { const SelfExclusion = observer(({ is_app_settings, overlay_ref, setIsOverlayShown }: TSelfExclusion) => { const { client, ui } = useStore(); - const { currency, is_virtual, is_switching, standpoint, is_eu, is_uk, logout, landing_company_shortcode } = client; + const { currency, is_virtual, is_switching, standpoint, is_eu, logout, landing_company_shortcode } = client; const { is_tablet } = ui; const is_wrapper_bypassed = false; const is_mf = landing_company_shortcode === 'maltainvest'; @@ -440,7 +440,6 @@ const SelfExclusion = observer(({ is_app_settings, overlay_ref, setIsOverlayShow is_eu, is_mf, is_tablet, - is_uk, is_wrapper_bypassed, objectValuesToString, overlay_ref, diff --git a/packages/core/src/Modules/ComplaintsPolicy/Components/complaints-policy-content.jsx b/packages/core/src/Modules/ComplaintsPolicy/Components/complaints-policy-content.jsx index 861e5157ac8e..344ba9166a77 100644 --- a/packages/core/src/Modules/ComplaintsPolicy/Components/complaints-policy-content.jsx +++ b/packages/core/src/Modules/ComplaintsPolicy/Components/complaints-policy-content.jsx @@ -100,7 +100,7 @@ const getGeneralQueriesText = landing_company_shortcode => { ); }; -const getYourDecisionText = (is_uk, landing_company_shortcode) => { +const getYourDecisionText = landing_company_shortcode => { const texts = []; texts.push( @@ -137,26 +137,6 @@ const getYourDecisionText = (is_uk, landing_company_shortcode) => { ]} /> ); - - if (is_uk) { - texts.push( - <Localize - key={texts.length} - i18n_default_text='<0/><1/>If you reside in the UK and you are unhappy with our response you may escalate your complaint to the <2>Financial Ombudsman Service</2>.' - components={[ - <br key={0} />, - <br key={1} />, - <a - key={2} - className='link link--orange' - rel='noopener noreferrer' - target='_blank' - href='https://www.financial-ombudsman.org.uk/' - />, - ]} - /> - ); - } } return texts; @@ -179,7 +159,7 @@ const getSubmissionOfAComplaintText = () => ( const Content = observer(({ landing_company_shortcode }) => { const { client } = useStore(); - const { is_uk, mt5_login_list } = client; + const { mt5_login_list } = client; const policy_content = [ { id: 'introduction', @@ -226,7 +206,7 @@ const Content = observer(({ landing_company_shortcode }) => { }, { title: localize('3.4. Your decision'), - text: getYourDecisionText(is_uk, landing_company_shortcode), + text: getYourDecisionText(landing_company_shortcode), }, ], }, diff --git a/packages/core/src/Stores/client-store.js b/packages/core/src/Stores/client-store.js index 90aba42ba69d..d5a6effde598 100644 --- a/packages/core/src/Stores/client-store.js +++ b/packages/core/src/Stores/client-store.js @@ -297,7 +297,6 @@ export default class ClientStore extends BaseStore { should_show_eu_error: computed, is_virtual: computed, is_eu: computed, - is_uk: computed, is_brazil: computed, can_upgrade: computed, can_upgrade_to: computed, @@ -876,10 +875,6 @@ export default class ClientStore extends BaseStore { return this.clients_country === 'br'; } - get is_uk() { - return this.residence === 'gb'; - } - get can_upgrade() { return this.upgrade_info && (this.upgrade_info.can_upgrade || this.upgrade_info.can_open_multi); } diff --git a/packages/stores/src/mockStore.ts b/packages/stores/src/mockStore.ts index c53131dd8bfa..91bfafb24ae6 100644 --- a/packages/stores/src/mockStore.ts +++ b/packages/stores/src/mockStore.ts @@ -220,7 +220,6 @@ const mock = (): TStores & { is_mock: boolean } => { switched: false, switch_broadcast: false, switchEndSignal: jest.fn(), - is_uk: false, isEligibleForMoreRealMt5: jest.fn(), isEligibleForMoreDemoMt5Svg: jest.fn(), updateMT5Status: jest.fn(), diff --git a/packages/stores/types.ts b/packages/stores/types.ts index 64abfe6f33ed..79634cdd875a 100644 --- a/packages/stores/types.ts +++ b/packages/stores/types.ts @@ -449,7 +449,6 @@ type TClientStore = { is_dxtrade_allowed: boolean; is_eu_country: boolean; is_eu: boolean; - is_uk: boolean; is_unwelcome: boolean; is_single_currency: boolean; is_social_signup: boolean; From e3017a59cd2d5139957736e9dd889be3995a2eb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CMatin-deriv=E2=80=9D?= <matin@deriv.com> Date: Thu, 9 May 2024 13:19:23 +0800 Subject: [PATCH 9/9] chore: empty commit