{
'traders-hub-header__tradershub--active':
pathname === routes.traders_hub ||
pathname === routes.traders_hub_v2 ||
- pathname === routes.wallets,
+ pathname === routes.wallets ||
+ pathname === routes.root,
})}
onClick={() => history.push(redirectRoutes())}
>
From 64696083e6c34396726f7332d503cf82945345b2 Mon Sep 17 00:00:00 2001
From: sergei-deriv
Date: Tue, 7 May 2024 13:40:42 +0300
Subject: [PATCH 37/65] fix: implement sonalcloud suggestions
---
.../trustpilot-star-rating/trustpilot-star-rating.tsx | 2 +-
.../src/App/Containers/Layout/header/traders-hub-header.tsx | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/packages/appstore/src/components/trustpilot-star-rating/trustpilot-star-rating.tsx b/packages/appstore/src/components/trustpilot-star-rating/trustpilot-star-rating.tsx
index 8600c7a6fb1f..4e759b481f76 100644
--- a/packages/appstore/src/components/trustpilot-star-rating/trustpilot-star-rating.tsx
+++ b/packages/appstore/src/components/trustpilot-star-rating/trustpilot-star-rating.tsx
@@ -8,7 +8,7 @@ const TrustpilotStarRating = ({ score }: { score: number }) => {
{[...Array(5)].map((_, idx) => (
Date: Tue, 7 May 2024 16:11:08 +0300
Subject: [PATCH 38/65] fix: repair tests
---
.../__tests__/trade-url-params-config.spec.ts | 25 +++++++++++++++----
1 file changed, 20 insertions(+), 5 deletions(-)
diff --git a/packages/shared/src/utils/contract/__tests__/trade-url-params-config.spec.ts b/packages/shared/src/utils/contract/__tests__/trade-url-params-config.spec.ts
index 870c98345cea..2496d9ea8e42 100644
--- a/packages/shared/src/utils/contract/__tests__/trade-url-params-config.spec.ts
+++ b/packages/shared/src/utils/contract/__tests__/trade-url-params-config.spec.ts
@@ -39,7 +39,10 @@ describe('getTradeURLParams', () => {
Object.defineProperty(window, 'location', {
configurable: true,
enumerable: true,
- value: new URL('https://localhost:8443/'),
+ value: {
+ hostname: 'https://localhost:8443/',
+ pathname: routes.trade,
+ },
});
});
@@ -128,28 +131,40 @@ describe('setTradeURLParams', () => {
setTradeURLParams({
granularity: 0,
});
- expect(spyHistoryReplaceState).toBeCalledWith({}, document.title, `/?interval=${oneTickInterval}`);
+ expect(spyHistoryReplaceState).toBeCalledWith(
+ {},
+ document.title,
+ `${routes.trade}?interval=${oneTickInterval}`
+ );
});
it('should set chart_type query param into URL based on the received chart_type value', () => {
const spyHistoryReplaceState = jest.spyOn(window.history, 'replaceState');
setTradeURLParams({
chartType: areaChartType.value,
});
- expect(spyHistoryReplaceState).toBeCalledWith({}, document.title, `/?chart_type=${areaChartType.text}`);
+ expect(spyHistoryReplaceState).toBeCalledWith(
+ {},
+ document.title,
+ `${routes.trade}?chart_type=${areaChartType.text}`
+ );
});
it('should set symbol query param into URL based on the received symbol value', () => {
const spyHistoryReplaceState = jest.spyOn(window.history, 'replaceState');
setTradeURLParams({
symbol,
});
- expect(spyHistoryReplaceState).toBeCalledWith({}, document.title, `/?symbol=${symbol}`);
+ expect(spyHistoryReplaceState).toBeCalledWith({}, document.title, `${routes.trade}?symbol=${symbol}`);
});
it('should set trade_type query param into URL based on the received contract_type value', () => {
const spyHistoryReplaceState = jest.spyOn(window.history, 'replaceState');
setTradeURLParams({
contractType: TRADE_TYPES.ACCUMULATOR,
});
- expect(spyHistoryReplaceState).toBeCalledWith({}, document.title, `/?trade_type=${TRADE_TYPES.ACCUMULATOR}`);
+ expect(spyHistoryReplaceState).toBeCalledWith(
+ {},
+ document.title,
+ `${routes.trade}?trade_type=${TRADE_TYPES.ACCUMULATOR}`
+ );
});
it('should not set any query params into URL when called with empty object', () => {
const spyHistoryReplaceState = jest.spyOn(window.history, 'replaceState');
From 593f5e7a572c3ca7460f6f45dd2344a4e28000e8 Mon Sep 17 00:00:00 2001
From: sergei-deriv
Date: Wed, 8 May 2024 09:51:19 +0300
Subject: [PATCH 39/65] feat: get back changes for content because it will be
done by card trah-3251
---
.../containers/trading-app-card.tsx | 6 ++---
.../appstore/src/constants/platform-config.ts | 22 +++++--------------
packages/core/src/Stores/traders-hub-store.js | 16 ++++----------
.../src/utils/cfd/available-cfd-accounts.ts | 6 ++---
4 files changed, 14 insertions(+), 36 deletions(-)
diff --git a/packages/appstore/src/components/containers/trading-app-card.tsx b/packages/appstore/src/components/containers/trading-app-card.tsx
index 9e7e2f83a511..a141cae4012c 100644
--- a/packages/appstore/src/components/containers/trading-app-card.tsx
+++ b/packages/appstore/src/components/containers/trading-app-card.tsx
@@ -61,7 +61,7 @@ const TradingAppCard = ({
const { is_eu_user, is_demo_low_risk, content_flag, is_real, selected_account_type } = traders_hub;
const { current_language } = common;
const { is_account_being_created } = cfd;
- const { account_status: { authentication } = {}, is_logged_in } = client;
+ const { account_status: { authentication } = {} } = client;
const [is_open_position_svg_modal_open, setIsOpenPositionSvgModalOpen] = React.useState(false);
const demo_label = localize('Demo');
@@ -70,9 +70,7 @@ const TradingAppCard = ({
const low_risk_cr_non_eu = content_flag === ContentFlag.LOW_RISK_CR_NON_EU;
const app_platform =
- !is_eu_user || low_risk_cr_non_eu || is_demo_low_risk
- ? getAppstorePlatforms(is_logged_in)
- : getMFAppstorePlatforms();
+ !is_eu_user || low_risk_cr_non_eu || is_demo_low_risk ? getAppstorePlatforms() : getMFAppstorePlatforms();
const { app_desc, link_to, is_external, new_tab } = app_platform.find(config => config.name === name) || {
app_desc: description,
diff --git a/packages/appstore/src/constants/platform-config.ts b/packages/appstore/src/constants/platform-config.ts
index 0a5fb71fd8ba..cba13cf731b9 100644
--- a/packages/appstore/src/constants/platform-config.ts
+++ b/packages/appstore/src/constants/platform-config.ts
@@ -31,43 +31,33 @@ export interface MfPlatformConfig extends PlatformConfig {
app_title: string;
}
-export const getAppstorePlatforms = (is_for_authorized_user = true): PlatformConfig[] => [
+export const getAppstorePlatforms = (): PlatformConfig[] => [
{
name: getPlatformSettingsAppstore('trader').name,
- app_desc: is_for_authorized_user
- ? localize('Options and multipliers trading platform.')
- : localize('The options and multipliers trading platform'),
+ app_desc: localize('Options and multipliers trading platform.'),
link_to: routes.trade,
},
{
name: getPlatformSettingsAppstore('dbot').name,
- app_desc: is_for_authorized_user
- ? localize('Automate your trading, no coding needed.')
- : localize('The ultimate bot trading platform'),
+ app_desc: localize('Automate your trading, no coding needed.'),
link_to: routes.bot,
is_external: true,
},
{
name: getPlatformSettingsAppstore('smarttrader').name,
- app_desc: is_for_authorized_user
- ? localize('Our legacy options trading platform.')
- : localize('The legacy options trading platform'),
+ app_desc: localize('Our legacy options trading platform.'),
link_to: getUrlSmartTrader(),
is_external: true,
},
{
name: getPlatformSettingsAppstore('bbot').name,
- app_desc: is_for_authorized_user
- ? localize('Our legacy automated trading platform.')
- : localize('The legacy bot trading platform'),
+ app_desc: localize('Our legacy automated trading platform.'),
link_to: getUrlBinaryBot(),
is_external: true,
},
{
name: getPlatformSettingsAppstore('go').name,
- app_desc: is_for_authorized_user
- ? localize('Trade on the go with our mobile app.')
- : localize('The mobile trading app for multipliers'),
+ app_desc: localize('Trade on the go with our mobile app.'),
link_to: getStaticUrl('/deriv-go'),
is_external: true,
new_tab: true,
diff --git a/packages/core/src/Stores/traders-hub-store.js b/packages/core/src/Stores/traders-hub-store.js
index f25326b6d2d2..622d289305dd 100644
--- a/packages/core/src/Stores/traders-hub-store.js
+++ b/packages/core/src/Stores/traders-hub-store.js
@@ -373,26 +373,18 @@ export default class TradersHubStore extends BaseStore {
getAvailableCFDAccounts() {
const getAccountDesc = () => {
- if (!this.root_store.client.is_logged_in) {
- return this.is_eu_user
- ? localize('The MFSA-regulated account for CFDs on derived and financial instruments')
- : localize('CFDs on financial instruments');
- }
-
return !this.is_eu_user || this.is_demo_low_risk
? localize('This account offers CFDs on financial instruments.')
: localize('CFDs on derived and financial instruments.');
};
const getSwapFreeAccountDesc = () => {
- return this.root_store.client.is_logged_in
- ? localize(
- 'Trade swap-free CFDs on MT5 with forex, stocks, stock indices, commodities cryptocurrencies, ETFs and synthetic indices.'
- )
- : localize('Swap-free CFDs on selected financial and derived instruments');
+ return localize(
+ 'Trade swap-free CFDs on MT5 with forex, stocks, stock indices, commodities cryptocurrencies, ETFs and synthetic indices.'
+ );
};
const all_available_accounts = [
- ...getCFDAvailableAccount(this.root_store.client.is_logged_in),
+ ...getCFDAvailableAccount(),
{
name: !this.is_eu_user || this.is_demo_low_risk ? localize('Financial') : localize('CFDs'),
description: getAccountDesc(),
diff --git a/packages/shared/src/utils/cfd/available-cfd-accounts.ts b/packages/shared/src/utils/cfd/available-cfd-accounts.ts
index 4377703aa83f..1d7549d6a3c9 100644
--- a/packages/shared/src/utils/cfd/available-cfd-accounts.ts
+++ b/packages/shared/src/utils/cfd/available-cfd-accounts.ts
@@ -14,12 +14,10 @@ export interface AvailableAccount {
link_to?: string;
}
-export const getCFDAvailableAccount = (is_for_authorized_user = true) => [
+export const getCFDAvailableAccount = () => [
{
name: 'Derived',
- description: is_for_authorized_user
- ? localize('This account offers CFDs on derived instruments.')
- : localize('CFDs on derived instruments'),
+ description: localize('This account offers CFDs on derived instruments.'),
platform: CFD_PLATFORMS.MT5,
market_type: 'synthetic',
icon: 'Derived',
From dc0152b4714444db8e58c431c67e41af46f288ab Mon Sep 17 00:00:00 2001
From: sergei-deriv
Date: Wed, 8 May 2024 12:58:54 +0300
Subject: [PATCH 40/65] feat: create separate components for option and cfds
titles and description
---
.../cfds-listing-logged-out.scss | 6 --
.../cfds-listing-logged-out.tsx | 31 ++-----
.../cfds-description/cfds-description.tsx | 16 ++++
.../elements/cfds-description/index.tsx | 3 +
.../elements/cfds-title/cfds-title.scss | 5 ++
.../elements/cfds-title/cfds-title.tsx | 21 +++++
.../components/elements/cfds-title/index.tsx | 3 +
.../elements/options-description/index.tsx | 3 +
.../options-description.tsx | 35 ++++++++
.../elements/options-title/index.tsx | 3 +
.../elements/options-title/options-title.tsx | 26 ++++++
...options-miltipliers-listing-logged-out.tsx | 86 -------------------
.../index.tsx | 2 +-
...tions-multipliers-listing-logged-out.scss} | 2 +-
...options-multipliers-listing-logged-out.tsx | 42 +++++++++
.../ordered-platform-sections.tsx | 2 +-
16 files changed, 167 insertions(+), 119 deletions(-)
create mode 100644 packages/appstore/src/components/elements/cfds-description/cfds-description.tsx
create mode 100644 packages/appstore/src/components/elements/cfds-description/index.tsx
create mode 100644 packages/appstore/src/components/elements/cfds-title/cfds-title.scss
create mode 100644 packages/appstore/src/components/elements/cfds-title/cfds-title.tsx
create mode 100644 packages/appstore/src/components/elements/cfds-title/index.tsx
create mode 100644 packages/appstore/src/components/elements/options-description/index.tsx
create mode 100644 packages/appstore/src/components/elements/options-description/options-description.tsx
create mode 100644 packages/appstore/src/components/elements/options-title/index.tsx
create mode 100644 packages/appstore/src/components/elements/options-title/options-title.tsx
delete mode 100644 packages/appstore/src/components/options-miltipliers-listing-logged-out/options-miltipliers-listing-logged-out.tsx
rename packages/appstore/src/components/{options-miltipliers-listing-logged-out => options-multipliers-listing-logged-out}/index.tsx (57%)
rename packages/appstore/src/components/{options-miltipliers-listing-logged-out/options-miltipliers-listing-logged-out.scss => options-multipliers-listing-logged-out/options-multipliers-listing-logged-out.scss} (56%)
create mode 100644 packages/appstore/src/components/options-multipliers-listing-logged-out/options-multipliers-listing-logged-out.tsx
diff --git a/packages/appstore/src/components/cfds-listing-logged-out/cfds-listing-logged-out.scss b/packages/appstore/src/components/cfds-listing-logged-out/cfds-listing-logged-out.scss
index 2af044ba8db8..5be4a1a91798 100644
--- a/packages/appstore/src/components/cfds-listing-logged-out/cfds-listing-logged-out.scss
+++ b/packages/appstore/src/components/cfds-listing-logged-out/cfds-listing-logged-out.scss
@@ -1,10 +1,4 @@
.cfds-listing-logged-out {
- &__cfd-accounts-title {
- display: flex;
- justify-content: flex-start;
- align-items: center;
- }
-
&__cfd-full-row {
user-select: none;
display: grid;
diff --git a/packages/appstore/src/components/cfds-listing-logged-out/cfds-listing-logged-out.tsx b/packages/appstore/src/components/cfds-listing-logged-out/cfds-listing-logged-out.tsx
index 1056e7dc00de..1ff2feedce92 100644
--- a/packages/appstore/src/components/cfds-listing-logged-out/cfds-listing-logged-out.tsx
+++ b/packages/appstore/src/components/cfds-listing-logged-out/cfds-listing-logged-out.tsx
@@ -1,16 +1,18 @@
import React from 'react';
import { observer, useStore } from '@deriv/stores';
-import { Text, StaticUrl } from '@deriv/components';
+import { Text } from '@deriv/components';
import { redirectToLogin } from '@deriv/shared';
-import { getLanguage, localize, Localize } from '@deriv/translations';
+import { getLanguage, localize } from '@deriv/translations';
+import { getHasDivider } from 'Constants/utils';
import ListingContainer from 'Components/containers/listing-container';
import TradingAppCard from 'Components/containers/trading-app-card';
import PlatformLoader from 'Components/pre-loader/platform-loader';
-import { getHasDivider } from 'Constants/utils';
+import CFDsDescription from 'Components/elements/cfds-description';
+import CFDsTitle from 'Components/elements/cfds-title';
import './cfds-listing-logged-out.scss';
const CFDsListingLoggedOut = observer(() => {
- const { client, traders_hub, ui } = useStore();
+ const { client, traders_hub } = useStore();
const {
available_dxtrade_accounts,
available_ctrader_accounts,
@@ -22,28 +24,9 @@ const CFDsListingLoggedOut = observer(() => {
} = traders_hub;
const { is_landing_company_loaded, is_populating_mt5_account_list } = client;
- const { is_mobile } = ui;
return (
-
-
- {localize('CFDs')}
-
-
- )
- }
- description={
-
- Learn more0>'}
- components={[]}
- />
-
- }
- >
+ } description={}>
{localize('Deriv MT5')}
diff --git a/packages/appstore/src/components/elements/cfds-description/cfds-description.tsx b/packages/appstore/src/components/elements/cfds-description/cfds-description.tsx
new file mode 100644
index 000000000000..a4330feeb655
--- /dev/null
+++ b/packages/appstore/src/components/elements/cfds-description/cfds-description.tsx
@@ -0,0 +1,16 @@
+import React from 'react';
+import { Text, StaticUrl } from '@deriv/components';
+import { Localize } from '@deriv/translations';
+
+const CFDsDescription = () => {
+ return (
+
+ ]}
+ />
+
+ );
+};
+
+export default CFDsDescription;
diff --git a/packages/appstore/src/components/elements/cfds-description/index.tsx b/packages/appstore/src/components/elements/cfds-description/index.tsx
new file mode 100644
index 000000000000..c3a512b9de29
--- /dev/null
+++ b/packages/appstore/src/components/elements/cfds-description/index.tsx
@@ -0,0 +1,3 @@
+import CFDsDescription from './cfds-description';
+
+export default CFDsDescription;
diff --git a/packages/appstore/src/components/elements/cfds-title/cfds-title.scss b/packages/appstore/src/components/elements/cfds-title/cfds-title.scss
new file mode 100644
index 000000000000..98d5a88586e0
--- /dev/null
+++ b/packages/appstore/src/components/elements/cfds-title/cfds-title.scss
@@ -0,0 +1,5 @@
+.cfds-title {
+ display: flex;
+ justify-content: flex-start;
+ align-items: center;
+}
diff --git a/packages/appstore/src/components/elements/cfds-title/cfds-title.tsx b/packages/appstore/src/components/elements/cfds-title/cfds-title.tsx
new file mode 100644
index 000000000000..969b3c10d4bc
--- /dev/null
+++ b/packages/appstore/src/components/elements/cfds-title/cfds-title.tsx
@@ -0,0 +1,21 @@
+import React from 'react';
+import { Text } from '@deriv/components';
+import { observer, useStore } from '@deriv/stores';
+import { localize } from '@deriv/translations';
+import './cfds-title.scss';
+
+const CFDsTitle = observer(() => {
+ const { ui } = useStore();
+ const { is_mobile } = ui;
+
+ if (is_mobile) return null;
+ return (
+
+
+ {localize('CFDs')}
+
+
+ );
+});
+
+export default CFDsTitle;
diff --git a/packages/appstore/src/components/elements/cfds-title/index.tsx b/packages/appstore/src/components/elements/cfds-title/index.tsx
new file mode 100644
index 000000000000..d84f5d3f9fde
--- /dev/null
+++ b/packages/appstore/src/components/elements/cfds-title/index.tsx
@@ -0,0 +1,3 @@
+import CFDsTitle from './cfds-title';
+
+export default CFDsTitle;
diff --git a/packages/appstore/src/components/elements/options-description/index.tsx b/packages/appstore/src/components/elements/options-description/index.tsx
new file mode 100644
index 000000000000..e04fe83e4d6c
--- /dev/null
+++ b/packages/appstore/src/components/elements/options-description/index.tsx
@@ -0,0 +1,3 @@
+import OptionsTitle from './options-description';
+
+export default OptionsTitle;
diff --git a/packages/appstore/src/components/elements/options-description/options-description.tsx b/packages/appstore/src/components/elements/options-description/options-description.tsx
new file mode 100644
index 000000000000..092f8612ad53
--- /dev/null
+++ b/packages/appstore/src/components/elements/options-description/options-description.tsx
@@ -0,0 +1,35 @@
+import React from 'react';
+import { Text, StaticUrl } from '@deriv/components';
+import { Localize } from '@deriv/translations';
+
+type TOptionsDescription = {
+ is_eu_user: boolean;
+};
+
+const OptionsDescription = ({ is_eu_user }: TOptionsDescription) => {
+ return is_eu_user ? (
+
+ ]}
+ />
+
+ ) : (
+
+
+ ,
+ ]}
+ />
+
+
+ );
+};
+
+export default OptionsDescription;
diff --git a/packages/appstore/src/components/elements/options-title/index.tsx b/packages/appstore/src/components/elements/options-title/index.tsx
new file mode 100644
index 000000000000..d0a0ddf17aed
--- /dev/null
+++ b/packages/appstore/src/components/elements/options-title/index.tsx
@@ -0,0 +1,3 @@
+import OptionsTitle from './options-title';
+
+export default OptionsTitle;
diff --git a/packages/appstore/src/components/elements/options-title/options-title.tsx b/packages/appstore/src/components/elements/options-title/options-title.tsx
new file mode 100644
index 000000000000..42ed13befff2
--- /dev/null
+++ b/packages/appstore/src/components/elements/options-title/options-title.tsx
@@ -0,0 +1,26 @@
+import React from 'react';
+import { Text } from '@deriv/components';
+import { observer, useStore } from '@deriv/stores';
+import { Localize } from '@deriv/translations';
+
+type TOptionsTitle = {
+ is_eu_user: boolean;
+};
+
+const OptionsTitle = observer(({ is_eu_user }: TOptionsTitle) => {
+ const { ui } = useStore();
+ const { is_mobile } = ui;
+
+ if (is_mobile) return null;
+ return is_eu_user ? (
+
+
+
+ ) : (
+
+
+
+ );
+});
+
+export default OptionsTitle;
diff --git a/packages/appstore/src/components/options-miltipliers-listing-logged-out/options-miltipliers-listing-logged-out.tsx b/packages/appstore/src/components/options-miltipliers-listing-logged-out/options-miltipliers-listing-logged-out.tsx
deleted file mode 100644
index 3e1eeea8859e..000000000000
--- a/packages/appstore/src/components/options-miltipliers-listing-logged-out/options-miltipliers-listing-logged-out.tsx
+++ /dev/null
@@ -1,86 +0,0 @@
-import React from 'react';
-import { observer } from 'mobx-react-lite';
-import { Text, StaticUrl } from '@deriv/components';
-import { useStore } from '@deriv/stores';
-import { Localize } from '@deriv/translations';
-import ListingContainer from 'Components/containers/listing-container';
-import PlatformLoader from 'Components/pre-loader/platform-loader';
-import TradingAppCard from 'Components/containers/trading-app-card';
-import { BrandConfig } from 'Constants/platform-config';
-import { getHasDivider } from 'Constants/utils';
-import './options-miltipliers-listing-logged-out.scss';
-
-const OptionsTitleLoggedOut = observer(() => {
- const { traders_hub, ui } = useStore();
- const { is_eu_user } = traders_hub;
- const { is_mobile } = ui;
-
- if (is_mobile) return null;
- return is_eu_user ? (
-
-
-
- ) : (
-
-
-
- );
-});
-
-const Description = observer(() => {
- const { traders_hub } = useStore();
- const { is_eu_user } = traders_hub;
-
- return is_eu_user ? (
-
- ]}
- />
-
- ) : (
-
-
- ,
- ,
- ]}
- />
-
-
- );
-});
-
-const OptionsAndMultipliersListingLoggedOut = observer(() => {
- const { traders_hub, client } = useStore();
- const { available_platforms, is_eu_user } = traders_hub;
- const { is_landing_company_loaded } = client;
-
- return (
- } description={}>
- {is_landing_company_loaded ? (
- available_platforms.map((available_platform: BrandConfig, index: number) => (
-
- ))
- ) : (
-
- )}
-
- );
-});
-
-export default OptionsAndMultipliersListingLoggedOut;
diff --git a/packages/appstore/src/components/options-miltipliers-listing-logged-out/index.tsx b/packages/appstore/src/components/options-multipliers-listing-logged-out/index.tsx
similarity index 57%
rename from packages/appstore/src/components/options-miltipliers-listing-logged-out/index.tsx
rename to packages/appstore/src/components/options-multipliers-listing-logged-out/index.tsx
index 579106f28d1b..c4ffbe469387 100644
--- a/packages/appstore/src/components/options-miltipliers-listing-logged-out/index.tsx
+++ b/packages/appstore/src/components/options-multipliers-listing-logged-out/index.tsx
@@ -1,3 +1,3 @@
-import OptionsAndMultipliersListingLoggedOut from './options-miltipliers-listing-logged-out';
+import OptionsAndMultipliersListingLoggedOut from './options-multipliers-listing-logged-out';
export default OptionsAndMultipliersListingLoggedOut;
diff --git a/packages/appstore/src/components/options-miltipliers-listing-logged-out/options-miltipliers-listing-logged-out.scss b/packages/appstore/src/components/options-multipliers-listing-logged-out/options-multipliers-listing-logged-out.scss
similarity index 56%
rename from packages/appstore/src/components/options-miltipliers-listing-logged-out/options-miltipliers-listing-logged-out.scss
rename to packages/appstore/src/components/options-multipliers-listing-logged-out/options-multipliers-listing-logged-out.scss
index 680456b2814f..71d62a4eb072 100644
--- a/packages/appstore/src/components/options-miltipliers-listing-logged-out/options-miltipliers-listing-logged-out.scss
+++ b/packages/appstore/src/components/options-multipliers-listing-logged-out/options-multipliers-listing-logged-out.scss
@@ -1,4 +1,4 @@
-.options-miltipliers-listing-logged-out {
+.options-multipliers-listing-logged-out {
&__description {
max-width: 65rem;
}
diff --git a/packages/appstore/src/components/options-multipliers-listing-logged-out/options-multipliers-listing-logged-out.tsx b/packages/appstore/src/components/options-multipliers-listing-logged-out/options-multipliers-listing-logged-out.tsx
new file mode 100644
index 000000000000..8ae10692bd73
--- /dev/null
+++ b/packages/appstore/src/components/options-multipliers-listing-logged-out/options-multipliers-listing-logged-out.tsx
@@ -0,0 +1,42 @@
+import React from 'react';
+import { observer } from 'mobx-react-lite';
+import { useStore } from '@deriv/stores';
+import ListingContainer from 'Components/containers/listing-container';
+import PlatformLoader from 'Components/pre-loader/platform-loader';
+import TradingAppCard from 'Components/containers/trading-app-card';
+import OptionsDescription from 'Components/elements/options-description';
+import OptionsTitle from 'Components/elements/options-title';
+import { BrandConfig } from 'Constants/platform-config';
+import { getHasDivider } from 'Constants/utils';
+import './options-multipliers-listing-logged-out.scss';
+
+const OptionsAndMultipliersListingLoggedOut = observer(() => {
+ const { traders_hub, client } = useStore();
+ const { available_platforms, is_eu_user } = traders_hub;
+ const { is_landing_company_loaded } = client;
+
+ return (
+ }
+ description={}
+ >
+ {is_landing_company_loaded ? (
+ available_platforms.map((available_platform: BrandConfig, index: number) => (
+
+ ))
+ ) : (
+
+ )}
+
+ );
+});
+
+export default OptionsAndMultipliersListingLoggedOut;
diff --git a/packages/appstore/src/components/ordered-platform-sections/ordered-platform-sections.tsx b/packages/appstore/src/components/ordered-platform-sections/ordered-platform-sections.tsx
index 6b7fb3d383e3..8365a54c6f2a 100644
--- a/packages/appstore/src/components/ordered-platform-sections/ordered-platform-sections.tsx
+++ b/packages/appstore/src/components/ordered-platform-sections/ordered-platform-sections.tsx
@@ -1,7 +1,7 @@
import React from 'react';
import classNames from 'classnames';
import { observer, useStore } from '@deriv/stores';
-import OptionsAndMultipliersListingLoggedOut from 'Components/options-miltipliers-listing-logged-out';
+import OptionsAndMultipliersListingLoggedOut from 'Components/options-multipliers-listing-logged-out';
import CFDsListingLoggedOut from 'Components/cfds-listing-logged-out';
import './ordered-platform-sections.scss';
From 66fc85799dd8e625e49dc9b3031f2a3fbdda20f3 Mon Sep 17 00:00:00 2001
From: sergei-deriv
Date: Fri, 10 May 2024 15:49:20 +0300
Subject: [PATCH 41/65] feat: remove waiting for landing company and show just
eu and non-eu versions
---
.../cfds-listing-logged-out.tsx | 123 ++++++++----------
...options-multipliers-listing-logged-out.tsx | 30 ++---
.../ordered-platform-sections.tsx | 4 +-
.../tabs-or-title/tabs-or-title.tsx | 4 +-
.../traders-hub-logged-out.scss | 6 -
.../traders-hub-logged-out.tsx | 10 +-
packages/core/src/Stores/client-store.js | 11 --
packages/stores/src/mockStore.ts | 1 -
packages/stores/types.ts | 1 -
9 files changed, 72 insertions(+), 118 deletions(-)
diff --git a/packages/appstore/src/components/cfds-listing-logged-out/cfds-listing-logged-out.tsx b/packages/appstore/src/components/cfds-listing-logged-out/cfds-listing-logged-out.tsx
index 1ff2feedce92..8fcfe5be63ce 100644
--- a/packages/appstore/src/components/cfds-listing-logged-out/cfds-listing-logged-out.tsx
+++ b/packages/appstore/src/components/cfds-listing-logged-out/cfds-listing-logged-out.tsx
@@ -6,25 +6,20 @@ import { getLanguage, localize } from '@deriv/translations';
import { getHasDivider } from 'Constants/utils';
import ListingContainer from 'Components/containers/listing-container';
import TradingAppCard from 'Components/containers/trading-app-card';
-import PlatformLoader from 'Components/pre-loader/platform-loader';
import CFDsDescription from 'Components/elements/cfds-description';
import CFDsTitle from 'Components/elements/cfds-title';
import './cfds-listing-logged-out.scss';
const CFDsListingLoggedOut = observer(() => {
- const { client, traders_hub } = useStore();
+ const { traders_hub } = useStore();
const {
available_dxtrade_accounts,
available_ctrader_accounts,
combined_cfd_mt5_accounts,
selected_region,
is_eu_user,
- CFDs_restricted_countries,
- financial_restricted_countries,
} = traders_hub;
- const { is_landing_company_loaded, is_populating_mt5_account_list } = client;
-
return (
} description={}>
@@ -32,61 +27,51 @@ const CFDsListingLoggedOut = observer(() => {
{localize('Deriv MT5')}
- {is_landing_company_loaded && !is_populating_mt5_account_list ? (
-
- {combined_cfd_mt5_accounts.map((existing_account, index: number) => {
- const list_size = combined_cfd_mt5_accounts.length;
- return (
- redirectToLogin(false, getLanguage())}
- market_type='all'
- />
- );
- })}
-
- ) : (
-
- )}
- {!is_eu_user && !CFDs_restricted_countries && !financial_restricted_countries && (
+ {combined_cfd_mt5_accounts.map((existing_account, index: number) => {
+ const list_size = combined_cfd_mt5_accounts.length;
+ return (
+ redirectToLogin(false, getLanguage())}
+ market_type='all'
+ />
+ );
+ })}
+ {!is_eu_user && (
)}
- {!is_eu_user && !CFDs_restricted_countries && !financial_restricted_countries && (
+ {!is_eu_user && (
{localize('Deriv cTrader')}
)}
- {is_landing_company_loaded ? (
- available_ctrader_accounts.map(account => (
- redirectToLogin(false, getLanguage())}
- key={`trading_app_card_${account.name}`}
- market_type='all'
- />
- ))
- ) : (
-
- )}
- {!is_eu_user && !CFDs_restricted_countries && !financial_restricted_countries && (
+ {available_ctrader_accounts.map(account => (
+ redirectToLogin(false, getLanguage())}
+ key={`trading_app_card_${account.name}`}
+ market_type='all'
+ />
+ ))}
+ {!is_eu_user && (
@@ -99,24 +84,20 @@ const CFDsListingLoggedOut = observer(() => {
)}
- {is_landing_company_loaded ? (
- available_dxtrade_accounts?.map(account => (
- redirectToLogin(false, getLanguage())}
- key={`trading_app_card_${account.name}`}
- market_type='all'
- />
- ))
- ) : (
-
- )}
+ {available_dxtrade_accounts?.map(account => (
+ redirectToLogin(false, getLanguage())}
+ key={`trading_app_card_${account.name}`}
+ market_type='all'
+ />
+ ))}
);
});
diff --git a/packages/appstore/src/components/options-multipliers-listing-logged-out/options-multipliers-listing-logged-out.tsx b/packages/appstore/src/components/options-multipliers-listing-logged-out/options-multipliers-listing-logged-out.tsx
index 8ae10692bd73..d263a59617c8 100644
--- a/packages/appstore/src/components/options-multipliers-listing-logged-out/options-multipliers-listing-logged-out.tsx
+++ b/packages/appstore/src/components/options-multipliers-listing-logged-out/options-multipliers-listing-logged-out.tsx
@@ -2,7 +2,6 @@ import React from 'react';
import { observer } from 'mobx-react-lite';
import { useStore } from '@deriv/stores';
import ListingContainer from 'Components/containers/listing-container';
-import PlatformLoader from 'Components/pre-loader/platform-loader';
import TradingAppCard from 'Components/containers/trading-app-card';
import OptionsDescription from 'Components/elements/options-description';
import OptionsTitle from 'Components/elements/options-title';
@@ -11,30 +10,25 @@ import { getHasDivider } from 'Constants/utils';
import './options-multipliers-listing-logged-out.scss';
const OptionsAndMultipliersListingLoggedOut = observer(() => {
- const { traders_hub, client } = useStore();
+ const { traders_hub } = useStore();
const { available_platforms, is_eu_user } = traders_hub;
- const { is_landing_company_loaded } = client;
return (
}
description={}
>
- {is_landing_company_loaded ? (
- available_platforms.map((available_platform: BrandConfig, index: number) => (
-
- ))
- ) : (
-
- )}
+ {available_platforms.map((available_platform: BrandConfig, index: number) => (
+
+ ))}
);
});
diff --git a/packages/appstore/src/components/ordered-platform-sections/ordered-platform-sections.tsx b/packages/appstore/src/components/ordered-platform-sections/ordered-platform-sections.tsx
index 8365a54c6f2a..f38d19f50e56 100644
--- a/packages/appstore/src/components/ordered-platform-sections/ordered-platform-sections.tsx
+++ b/packages/appstore/src/components/ordered-platform-sections/ordered-platform-sections.tsx
@@ -34,10 +34,10 @@ const GetOrderedPlatformSections = observer(
const OrderedPlatformSections = observer(({ isDesktop = false }: TOrderedPlatformSections) => {
const { traders_hub, client } = useStore();
- const { is_mt5_allowed } = client;
+ const { is_mt5_allowed, is_logged_in } = client;
const { selected_platform_type } = traders_hub;
- if (is_mt5_allowed) {
+ if ((is_logged_in && is_mt5_allowed) || !is_logged_in) {
return isDesktop ? (
) : (
diff --git a/packages/appstore/src/components/tabs-or-title/tabs-or-title.tsx b/packages/appstore/src/components/tabs-or-title/tabs-or-title.tsx
index c40998ddc3c5..b1a2ee13c7cb 100644
--- a/packages/appstore/src/components/tabs-or-title/tabs-or-title.tsx
+++ b/packages/appstore/src/components/tabs-or-title/tabs-or-title.tsx
@@ -7,7 +7,7 @@ import './tabs-or-title.scss';
const TabsOrTitle = observer(() => {
const { traders_hub, client } = useStore();
- const { is_mt5_allowed } = client;
+ const { is_mt5_allowed, is_logged_in } = client;
const { selected_platform_type, setTogglePlatformType, is_eu_user } = traders_hub;
const platform_toggle_options = getPlatformToggleOptions(is_eu_user);
@@ -22,7 +22,7 @@ const TabsOrTitle = observer(() => {
setTogglePlatformType(event.target.value);
};
- return is_mt5_allowed ? (
+ return (is_logged_in && is_mt5_allowed) || !is_logged_in ? (
{
const { traders_hub, client, ui } = useStore();
const { is_desktop } = ui;
- const { is_mt5_allowed, clients_country, is_landing_company_loaded, getLandingCompany } = client;
+ const { clients_country } = client;
const { setTogglePlatformType, selectRegion, is_eu_user } = traders_hub;
React.useEffect(() => {
if (clients_country) {
- getLandingCompany(clients_country);
if (isEuCountry(clients_country)) {
setTogglePlatformType('cfd');
selectRegion('EU');
@@ -25,16 +24,15 @@ const TradersHubLoggedOut = observer(() => {
selectRegion('Non-EU');
}
}
- }, [clients_country, getLandingCompany, setTogglePlatformType]);
+ }, [clients_country, setTogglePlatformType]);
- if (!clients_country || !is_landing_company_loaded) return ;
+ if (!clients_country) return ;
return (
diff --git a/packages/core/src/Stores/client-store.js b/packages/core/src/Stores/client-store.js
index 5abde50b5d42..a63d2d01dbb1 100644
--- a/packages/core/src/Stores/client-store.js
+++ b/packages/core/src/Stores/client-store.js
@@ -415,7 +415,6 @@ export default class ClientStore extends BaseStore {
unsubscribeFromExchangeRate: action.bound,
unsubscribeFromAllExchangeRates: action.bound,
setExchangeRates: action.bound,
- getLandingCompany: action.bound,
});
reaction(
@@ -2851,14 +2850,4 @@ export default class ClientStore extends BaseStore {
});
this.setExchangeRates({});
};
-
- getLandingCompany = country => {
- WS.cache
- .landingCompany(country)
- .then(this.responseLandingCompany)
- .catch(error => {
- // eslint-disable-next-line no-console
- console.log(`Error: code = ${error?.error?.code}, message = ${error?.error?.message}`);
- });
- };
}
diff --git a/packages/stores/src/mockStore.ts b/packages/stores/src/mockStore.ts
index 88b886bcceeb..5215a5ab4b75 100644
--- a/packages/stores/src/mockStore.ts
+++ b/packages/stores/src/mockStore.ts
@@ -311,7 +311,6 @@ const mock = (): TStores & { is_mock: boolean } => {
subscribeToExchangeRate: jest.fn(),
unsubscribeFromExchangeRate: jest.fn(),
unsubscribeFromAllExchangeRates: jest.fn(),
- getLandingCompany: jest.fn(),
},
common: {
error: common_store_error,
diff --git a/packages/stores/types.ts b/packages/stores/types.ts
index 103f65925759..8d60557eeec0 100644
--- a/packages/stores/types.ts
+++ b/packages/stores/types.ts
@@ -620,7 +620,6 @@ type TClientStore = {
subscribeToExchangeRate: (base_currency: string, target_currency: string) => Promise
;
unsubscribeFromExchangeRate: (base_currency: string, target_currency: string) => Promise;
unsubscribeFromAllExchangeRates: () => void;
- getLandingCompany: (country: string) => void;
};
type TCommonStoreError = {
From 8811faa82eb14e81fde34c2ef92a321ab3d1b725 Mon Sep 17 00:00:00 2001
From: sergei-deriv
Date: Fri, 10 May 2024 16:55:48 +0300
Subject: [PATCH 42/65] feat: change routes to legacy th
---
.../appstore/src/components/routes/routes.tsx | 11 ++++----
.../core/src/App/Constants/routes-config.js | 28 +++++++++----------
packages/shared/src/utils/routes/routes.ts | 7 ++---
3 files changed, 22 insertions(+), 24 deletions(-)
diff --git a/packages/appstore/src/components/routes/routes.tsx b/packages/appstore/src/components/routes/routes.tsx
index b35e59f18426..e751dbcd2203 100644
--- a/packages/appstore/src/components/routes/routes.tsx
+++ b/packages/appstore/src/components/routes/routes.tsx
@@ -32,17 +32,16 @@ const Routes: React.FC = observer(() => {
return (
}>
- title_TH} />
+ (is_logged_in ? title_TH : title_TH_logged_out)}
+ />
localize('Onboarding')}
/>
- (is_logged_in ? title_TH : title_TH_logged_out)}
- />
);
diff --git a/packages/core/src/App/Constants/routes-config.js b/packages/core/src/App/Constants/routes-config.js
index 23b993547612..71f2da7eef30 100644
--- a/packages/core/src/App/Constants/routes-config.js
+++ b/packages/core/src/App/Constants/routes-config.js
@@ -104,6 +104,20 @@ const Cashier_V2 = React.lazy(() =>
const getModules = () => {
const modules = [
+ {
+ path: routes.trade,
+ component: Trader,
+ getTitle: () => localize('Trader'),
+ routes: [
+ {
+ path: routes.contract,
+ component: Trader,
+ getTitle: () => localize('Contract Details'),
+ is_authenticated: true,
+ },
+ { path: routes.error404, component: Trader, getTitle: () => localize('Error 404') },
+ ],
+ },
{
path: routes.bot,
component: Bot,
@@ -430,20 +444,6 @@ const getModules = () => {
},
],
},
- {
- path: routes.trade,
- component: Trader,
- getTitle: () => localize('Trader'),
- routes: [
- {
- path: routes.contract,
- component: Trader,
- getTitle: () => localize('Contract Details'),
- is_authenticated: true,
- },
- { path: routes.error404, component: Trader, getTitle: () => localize('Error 404') },
- ],
- },
{
path: routes.root,
component: AppStore,
diff --git a/packages/shared/src/utils/routes/routes.ts b/packages/shared/src/utils/routes/routes.ts
index a429cb42723b..ef0422d85d85 100644
--- a/packages/shared/src/utils/routes/routes.ts
+++ b/packages/shared/src/utils/routes/routes.ts
@@ -72,10 +72,9 @@ export const routes = {
complaints_policy: '/complaints-policy',
// Appstore
- appstore: '/appstore',
- traders_hub: '/appstore/traders-hub',
- onboarding: '/appstore/onboarding',
- compare_cfds: '/appstore/cfd-compare-acccounts',
+ traders_hub: '/',
+ onboarding: '/onboarding',
+ compare_cfds: '/cfd-compare-acccounts',
// Wallets
wallets: '/wallets',
From ce6f73c4c19cbf7489eb420b93cef1350c5c84fc Mon Sep 17 00:00:00 2001
From: sergei-deriv
Date: Fri, 10 May 2024 17:17:26 +0300
Subject: [PATCH 43/65] feat: change routes to legacy th 2
---
.../core/src/App/Constants/routes-config.js | 76 +++++++++----------
1 file changed, 35 insertions(+), 41 deletions(-)
diff --git a/packages/core/src/App/Constants/routes-config.js b/packages/core/src/App/Constants/routes-config.js
index 71f2da7eef30..df500c728af9 100644
--- a/packages/core/src/App/Constants/routes-config.js
+++ b/packages/core/src/App/Constants/routes-config.js
@@ -104,20 +104,6 @@ const Cashier_V2 = React.lazy(() =>
const getModules = () => {
const modules = [
- {
- path: routes.trade,
- component: Trader,
- getTitle: () => localize('Trader'),
- routes: [
- {
- path: routes.contract,
- component: Trader,
- getTitle: () => localize('Contract Details'),
- is_authenticated: true,
- },
- { path: routes.error404, component: Trader, getTitle: () => localize('Error 404') },
- ],
- },
{
path: routes.bot,
component: Bot,
@@ -297,12 +283,6 @@ const getModules = () => {
},
],
},
- {
- path: routes.traders_hub,
- component: AppStore,
- is_authenticated: true,
- getTitle: () => localize("Trader's Hub"),
- },
{
path: routes.wallets,
component: Wallets,
@@ -333,25 +313,6 @@ const getModules = () => {
is_authenticated: true,
getTitle: () => localize('Cashier'),
},
- {
- path: routes.onboarding,
- component: AppStore,
- is_authenticated: false,
- getTitle: () => localize('Appstore'),
- routes: [
- {
- path: routes.traders_hub,
- component: AppStore,
- getTitle: () => localize("Trader's Hub"),
- },
- {
- path: routes.onboarding,
- component: AppStore,
- is_authenticated: false,
- getTitle: () => localize('Onboarding'),
- },
- ],
- },
{
path: routes.cashier,
component: Cashier,
@@ -445,10 +406,43 @@ const getModules = () => {
],
},
{
- path: routes.root,
+ path: routes.trade,
+ component: Trader,
+ getTitle: () => localize('Trader'),
+ routes: [
+ {
+ path: routes.contract,
+ component: Trader,
+ getTitle: () => localize('Contract Details'),
+ is_authenticated: true,
+ },
+ { path: routes.error404, component: Trader, getTitle: () => localize('Error 404') },
+ ],
+ },
+ {
+ path: routes.onboarding,
component: AppStore,
is_authenticated: false,
- getTitle: () => localize('Deriv App'),
+ getTitle: () => localize('Appstore'),
+ routes: [
+ {
+ path: routes.traders_hub,
+ component: AppStore,
+ getTitle: () => localize("Trader's Hub"),
+ },
+ {
+ path: routes.onboarding,
+ component: AppStore,
+ is_authenticated: false,
+ getTitle: () => localize('Onboarding'),
+ },
+ ],
+ },
+ {
+ path: routes.traders_hub,
+ component: AppStore,
+ is_authenticated: false,
+ getTitle: () => localize("Trader's Hub"),
},
];
From 4bc0aaf75a832577d7c243f5a77c20b4853febd5 Mon Sep 17 00:00:00 2001
From: sergei-deriv
Date: Fri, 10 May 2024 18:11:45 +0300
Subject: [PATCH 44/65] fix: repair tests due to route changes
---
.../__tests__/cfd-password-modal.spec.js | 19 ++++++++++++++++++-
.../Layout/header/__tests__/header.spec.tsx | 5 +++--
.../traders-hub-home-button.spec.tsx | 12 +++++++-----
3 files changed, 28 insertions(+), 8 deletions(-)
diff --git a/packages/cfd/src/Containers/__tests__/cfd-password-modal.spec.js b/packages/cfd/src/Containers/__tests__/cfd-password-modal.spec.js
index e754e10622d0..b068c370a9c4 100644
--- a/packages/cfd/src/Containers/__tests__/cfd-password-modal.spec.js
+++ b/packages/cfd/src/Containers/__tests__/cfd-password-modal.spec.js
@@ -1,7 +1,7 @@
import React from 'react';
import { Router } from 'react-router';
import { createBrowserHistory } from 'history';
-import { WS, getErrorMessages, validPassword, Jurisdiction } from '@deriv/shared';
+import { WS, getErrorMessages, validPassword, Jurisdiction, routes } from '@deriv/shared';
import { render, screen, fireEvent, waitFor } from '@testing-library/react';
import CFDPasswordModal from '../cfd-password-modal';
import CFDProviders from '../../cfd-providers';
@@ -91,7 +91,24 @@ describe('', () => {
document.body.removeChild(modal_root_el);
});
+ const originalWindowLocation = window.location;
+
+ beforeEach(() => {
+ Object.defineProperty(window, 'location', {
+ configurable: true,
+ enumerable: true,
+ value: {
+ pathname: routes.trade,
+ },
+ });
+ });
+
afterEach(() => {
+ Object.defineProperty(window, 'location', {
+ configurable: true,
+ enumerable: true,
+ value: originalWindowLocation,
+ });
jest.clearAllMocks();
});
diff --git a/packages/core/src/App/Containers/Layout/header/__tests__/header.spec.tsx b/packages/core/src/App/Containers/Layout/header/__tests__/header.spec.tsx
index 0ba1db00c2a6..40747d069702 100644
--- a/packages/core/src/App/Containers/Layout/header/__tests__/header.spec.tsx
+++ b/packages/core/src/App/Containers/Layout/header/__tests__/header.spec.tsx
@@ -2,6 +2,7 @@ import React from 'react';
import { useLocation } from 'react-router-dom';
import { StoreProvider, mockStore } from '@deriv/stores';
import { render, screen } from '@testing-library/react';
+import { routes } from '@deriv/shared';
import Header from '../header';
jest.mock('@deriv/hooks', () => ({
@@ -33,7 +34,7 @@ describe('Header', () => {
it('should render the "TradersHubHeader" component if user is logged in and in traders hub route', async () => {
(useLocation as jest.Mock).mockReturnValue({
- pathname: '/appstore/traders-hub',
+ pathname: routes.traders_hub,
});
renderComponent();
expect(await screen.findByTestId('dt_traders_hub_header')).toBeInTheDocument();
@@ -42,7 +43,7 @@ describe('Header', () => {
it('should render the "DTraderHeader" component if user is logged in and not in the traders hub route', async () => {
(useLocation as jest.Mock).mockReturnValue({
- pathname: '/',
+ pathname: routes.trade,
});
renderComponent();
expect(await screen.findByTestId('dt_dtrader_header')).toBeInTheDocument();
diff --git a/packages/core/src/App/Containers/Layout/header/__tests__/traders-hub-home-button.spec.tsx b/packages/core/src/App/Containers/Layout/header/__tests__/traders-hub-home-button.spec.tsx
index b0cd400a98d2..c842c8b892d1 100644
--- a/packages/core/src/App/Containers/Layout/header/__tests__/traders-hub-home-button.spec.tsx
+++ b/packages/core/src/App/Containers/Layout/header/__tests__/traders-hub-home-button.spec.tsx
@@ -3,11 +3,13 @@ import { StoreProvider, mockStore } from '@deriv/stores';
import { render, screen } from '@testing-library/react';
import TradersHubHomeButton from '../traders-hub-home-button';
-jest.mock('react-router', () => ({
- ...jest.requireActual('react-router'),
- useHistory: () => ({ history: {} }),
- useLocation: () => ({ pathname: '/appstore/traders-hub' }),
-}));
+jest.mock('react-router', () => {
+ return {
+ ...jest.requireActual('react-router'),
+ useHistory: () => ({ history: {} }),
+ useLocation: () => ({ pathname: '/' }),
+ };
+});
describe('TradersHubHomeButton', () => {
it("should display the text Trader's Hub in the header", () => {
From b1648364d5e783e182ae89dab6d01ed0ab49f4da Mon Sep 17 00:00:00 2001
From: sergei-deriv
Date: Wed, 15 May 2024 12:00:32 +0300
Subject: [PATCH 45/65] feat: add exact to the trades_hub route
---
packages/core/src/App/Constants/routes-config.js | 1 +
1 file changed, 1 insertion(+)
diff --git a/packages/core/src/App/Constants/routes-config.js b/packages/core/src/App/Constants/routes-config.js
index 7590a32a4948..0fb3b9b3ac56 100644
--- a/packages/core/src/App/Constants/routes-config.js
+++ b/packages/core/src/App/Constants/routes-config.js
@@ -441,6 +441,7 @@ const getModules = () => {
{
path: routes.traders_hub,
component: AppStore,
+ exact: true,
is_authenticated: false,
getTitle: () => localize("Trader's Hub"),
},
From 6bebd28d3bf47b02439a65bc079ac2f9b72f2233 Mon Sep 17 00:00:00 2001
From: sergei-deriv
Date: Wed, 15 May 2024 12:07:06 +0300
Subject: [PATCH 46/65] feat: add position absolute to the image
---
.../get-started-trading-banner/get-started-trading-banner.scss | 3 +++
1 file changed, 3 insertions(+)
diff --git a/packages/appstore/src/components/get-started-trading-banner/get-started-trading-banner.scss b/packages/appstore/src/components/get-started-trading-banner/get-started-trading-banner.scss
index 5cea243ebfcf..9cdd0f69afe1 100644
--- a/packages/appstore/src/components/get-started-trading-banner/get-started-trading-banner.scss
+++ b/packages/appstore/src/components/get-started-trading-banner/get-started-trading-banner.scss
@@ -3,6 +3,7 @@
border-radius: $BORDER_RADIUS * 4;
&__content {
+ position: relative;
display: flex;
justify-content: space-between;
@@ -42,6 +43,8 @@
}
&__image {
+ position: absolute;
+ right: 0;
margin-inline-end: 1.2rem;
@include mobile {
From 7b3c39db282a3e8d587f6032747a053fb940904e Mon Sep 17 00:00:00 2001
From: sergei-deriv
Date: Wed, 15 May 2024 13:34:23 +0300
Subject: [PATCH 47/65] feat: add redirection from old traders hub route to the
new one
---
packages/appstore/src/components/routes/routes.tsx | 6 +++---
packages/core/src/App/Constants/routes-config.js | 10 ++++++++++
packages/shared/src/utils/routes/routes.ts | 1 +
3 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/packages/appstore/src/components/routes/routes.tsx b/packages/appstore/src/components/routes/routes.tsx
index 8853402610fa..42d13ce70371 100644
--- a/packages/appstore/src/components/routes/routes.tsx
+++ b/packages/appstore/src/components/routes/routes.tsx
@@ -14,7 +14,7 @@ const TradersHubLoggedOut = React.lazy(
const Routes: React.FC = observer(() => {
const { client } = useStore();
- const { is_logged_in, has_wallet } = client;
+ const { is_logged_in, is_logging_in, has_wallet } = client;
const history = useHistory();
const title_TH = localize("Trader's Hub");
@@ -29,8 +29,8 @@ const Routes: React.FC = observer(() => {
(is_logged_in ? title_TH : title_TH_logged_out)}
+ component={is_logged_in || is_logging_in ? TradersHub : TradersHubLoggedOut}
+ getTitle={() => (is_logged_in || is_logging_in ? title_TH : title_TH_logged_out)}
/>
})
);
+const RedirectToNewTradersHub = () => {
+ return ;
+};
+
const getModules = () => {
const modules = [
{
@@ -445,6 +449,12 @@ const getModules = () => {
is_authenticated: false,
getTitle: () => localize("Trader's Hub"),
},
+ {
+ path: routes.old_traders_hub,
+ component: RedirectToNewTradersHub,
+ is_authenticated: false,
+ getTitle: () => localize("Trader's Hub"),
+ },
];
return modules;
diff --git a/packages/shared/src/utils/routes/routes.ts b/packages/shared/src/utils/routes/routes.ts
index ef0422d85d85..79a30c57dc7c 100644
--- a/packages/shared/src/utils/routes/routes.ts
+++ b/packages/shared/src/utils/routes/routes.ts
@@ -72,6 +72,7 @@ export const routes = {
complaints_policy: '/complaints-policy',
// Appstore
+ old_traders_hub: '/appstore/traders-hub',
traders_hub: '/',
onboarding: '/onboarding',
compare_cfds: '/cfd-compare-acccounts',
From 3e97a08809a8454e2949e9ccae1694f191e5fa0e Mon Sep 17 00:00:00 2001
From: nijil-deriv
Date: Thu, 16 May 2024 18:21:48 +0400
Subject: [PATCH 48/65] fix: same route for wallets and TH
---
.../Account/page-overlay-wrapper.tsx | 6 +-
packages/appstore/package.json | 1 +
.../routes/route-with-sub-routes.jsx | 12 +-
.../appstore/src/components/routes/routes.tsx | 16 +-
.../modules/Page404/Components/Page404.tsx | 20 +
.../Components/__tests__/Page404.spec.tsx | 19 +
.../appstore/src/modules/Page404/index.ts | 3 +
packages/appstore/src/types/common.types.ts | 1 -
.../components/src/components/icon/icons.js | 7 +
.../route-with-subroutes.tsx | 4 +-
packages/core/src/App/AppContent.tsx | 2 -
.../Components/Layout/Header/menu-link.tsx | 4 +-
.../Components/Layout/Header/menu-links.jsx | 4 +-
.../Layout/Header/toggle-menu-drawer.jsx | 15 +-
.../core/src/App/Constants/routes-config.js | 36 +-
.../account-switcher-wallet-mobile.tsx | 2 +-
.../account-switcher-wallet.tsx | 2 +-
.../__tests__/default-mobile-links.spec.tsx | 65 +-
.../Layout/header/default-mobile-links.tsx | 36 +-
.../App/Containers/Layout/header/header.tsx | 3 +-
.../header/traders-hub-header-wallets.tsx | 82 +-
.../Layout/header/traders-hub-header.tsx | 28 +-
.../Layout/header/traders-hub-home-button.tsx | 9 +-
.../wallets-upgrade-logout-modal.tsx | 2 +-
.../notification-list-wrapper.tsx | 3 +-
.../src/App/Containers/Redirect/redirect.jsx | 25 +-
packages/core/src/Stores/client-store.js | 4 +-
packages/shared/src/utils/routes/routes.ts | 16 +-
packages/stores/types.ts | 9 +-
.../crypto-payment-redirection.spec.tsx | 22 +-
.../wallets/component-tests/menu.spec.tsx | 2 +-
.../wallets-carousel-content.spec.tsx | 6 +-
.../DerivAppsSuccessFooter.tsx | 2 +-
.../DerivAppsTradingAccount.tsx | 4 +-
.../WalletListCardActions.tsx | 18 +-
.../__tests__/WalletListCardActions.spec.tsx | 16 +-
.../WalletNoWalletFoundState.scss | 40 -
.../WalletNoWalletFoundState.tsx | 33 -
.../WalletNoWalletFoundState/index.ts | 1 -
.../WalletsAddMoreCardBanner.tsx | 4 +-
.../WalletsCarouselContent.tsx | 4 +-
.../WalletsCarouselHeader.tsx | 2 +-
.../__tests__/WalletsCarouselHeader.spec.tsx | 2 +-
packages/wallets/src/components/index.ts | 1 -
.../WalletCashierContent.tsx | 14 +-
.../WalletCashierHeader.tsx | 22 +-
.../__tests__/WalletCashierHeader.spec.tsx | 2 +-
.../WalletFiatOnRamp/WalletFiatOnRamp.tsx | 2 +-
.../__tests__/WalletFiatOnRamp.spec.tsx | 4 +-
.../DepositCryptoTryFiatOnRamp.tsx | 2 +-
.../DepositCryptoTryFiatOnRamp.spec.tsx | 4 +-
.../cashier/modules/FiatOnRamp/FiatOnRamp.tsx | 2 +-
.../FiatOnRamp/__tests__/FiatOnRamp.spec.tsx | 4 +-
.../modules/ResetBalance/ResetBalance.tsx | 2 +-
.../__tests__/ResetBalance.spec.tsx | 2 +-
.../TransactionStatusSuccess.tsx | 2 +-
.../TransactionStatusSuccess.spec.tsx | 2 +-
.../modules/Transactions/Transactions.tsx | 4 +-
.../TransactionsNoDataState.tsx | 4 +-
.../__tests__/TransactionNoDataState.spec.tsx | 4 +-
.../TransferFormDropdown.tsx | 4 +-
.../WithdrawalCryptoReceipt.tsx | 2 +-
.../WithdrawalCryptoReceipt.spec.tsx | 2 +-
.../TransferNotAvailableProvider.tsx | 4 +-
.../WithdrawalNoBalance.tsx | 2 +-
.../src/features/cfd/CFDPlatformsList.tsx | 4 +-
.../cfd/CFDPlatformsListEmptyState.tsx | 2 +-
.../components/CTraderSuccessModalButtons.tsx | 2 +-
.../DxtradeEnterPasswordModal.tsx | 2 +-
.../MT5AccountAdded/MT5AccountAdded.tsx | 2 +-
.../__tests__/MT5AccountAdded.spec.tsx | 2 +-
.../MT5PasswordModalFooters.tsx | 2 +-
.../CompareAccounts/CompareAccountsHeader.tsx | 2 +-
.../wallets/src/public/images/no-wallet.svg | 1048 -----------------
packages/wallets/src/routes/Router.tsx | 61 +-
75 files changed, 315 insertions(+), 1495 deletions(-)
create mode 100644 packages/appstore/src/modules/Page404/Components/Page404.tsx
create mode 100644 packages/appstore/src/modules/Page404/Components/__tests__/Page404.spec.tsx
create mode 100644 packages/appstore/src/modules/Page404/index.ts
delete mode 100644 packages/wallets/src/components/WalletNoWalletFoundState/WalletNoWalletFoundState.scss
delete mode 100644 packages/wallets/src/components/WalletNoWalletFoundState/WalletNoWalletFoundState.tsx
delete mode 100644 packages/wallets/src/components/WalletNoWalletFoundState/index.ts
delete mode 100644 packages/wallets/src/public/images/no-wallet.svg
diff --git a/packages/account/src/Containers/Account/page-overlay-wrapper.tsx b/packages/account/src/Containers/Account/page-overlay-wrapper.tsx
index d288ff8469ce..f35613f5f28a 100644
--- a/packages/account/src/Containers/Account/page-overlay-wrapper.tsx
+++ b/packages/account/src/Containers/Account/page-overlay-wrapper.tsx
@@ -24,7 +24,7 @@ const PageOverlayWrapper = observer(({ routes, subroutes }: PageOverlayWrapperPr
const history = useHistory();
const { client, common, ui } = useStore();
const { is_mobile } = ui;
- const { has_wallet, logout } = client;
+ const { logout } = client;
const { is_from_derivgo } = common;
const passkeysMenuCloseActionEventTrack = React.useCallback(() => {
@@ -46,8 +46,8 @@ const PageOverlayWrapper = observer(({ routes, subroutes }: PageOverlayWrapperPr
passkeysMenuCloseActionEventTrack();
}
- has_wallet ? history.push(shared_routes.wallets) : history.push(shared_routes.traders_hub);
- }, [history, has_wallet]);
+ history.push(shared_routes.traders_hub);
+ }, [history]);
const selected_route = getSelectedRoute({ routes: subroutes as Array, pathname: location.pathname });
diff --git a/packages/appstore/package.json b/packages/appstore/package.json
index 0280c266be7e..134217c3505b 100644
--- a/packages/appstore/package.json
+++ b/packages/appstore/package.json
@@ -35,6 +35,7 @@
"@deriv/stores": "^1.0.0",
"@deriv/translations": "^1.0.0",
"@deriv/hooks": "^1.0.0",
+ "@deriv/wallets": "^1.0.0",
"classnames": "^2.2.6",
"mobx": "^6.6.1",
"mobx-react-lite": "^3.4.0",
diff --git a/packages/appstore/src/components/routes/route-with-sub-routes.jsx b/packages/appstore/src/components/routes/route-with-sub-routes.jsx
index f70de7445d92..cb24747d84c7 100644
--- a/packages/appstore/src/components/routes/route-with-sub-routes.jsx
+++ b/packages/appstore/src/components/routes/route-with-sub-routes.jsx
@@ -2,11 +2,20 @@ import React from 'react';
import { Redirect, Route } from 'react-router-dom';
import { redirectToLogin, isEmptyObject, routes, removeBranchName, default_title } from '@deriv/shared';
import { getLanguage } from '@deriv/translations';
+import Page404 from 'Modules/Page404';
const RouteWithSubRoutes = route => {
+ const validateRoute = pathname => {
+ if (pathname === '') return true;
+ return route.path === pathname || !!pathname.includes('wallet') || !!pathname.includes('compare-accounts');
+ };
+
const renderFactory = props => {
let result = null;
+ const pathname = removeBranchName(location.pathname);
+ const is_valid_route = validateRoute(pathname);
+
if (route.component instanceof Redirect) {
let to = route.to;
@@ -27,12 +36,11 @@ const RouteWithSubRoutes = route => {
{}
);
const has_default_subroute = !isEmptyObject(default_subroute);
- const pathname = removeBranchName(location.pathname);
result = (
{has_default_subroute && pathname === route.path && }
-
+ {is_valid_route ? : }
);
}
diff --git a/packages/appstore/src/components/routes/routes.tsx b/packages/appstore/src/components/routes/routes.tsx
index 8853402610fa..5c5ddcd0ce4b 100644
--- a/packages/appstore/src/components/routes/routes.tsx
+++ b/packages/appstore/src/components/routes/routes.tsx
@@ -3,7 +3,7 @@ import { Loading } from '@deriv/components';
import { observer, useStore } from '@deriv/stores';
import { localize } from '@deriv/translations';
import { routes } from '@deriv/shared';
-import { Switch, useHistory } from 'react-router-dom';
+import { Switch } from 'react-router-dom';
import RouteWithSubroutes from './route-with-sub-routes.jsx';
const Onboarding = React.lazy(() => import(/* webpackChunkName: "modules-onboarding" */ 'Modules/onboarding'));
@@ -11,25 +11,29 @@ const TradersHub = React.lazy(() => import(/* webpackChunkName: "modules-traders
const TradersHubLoggedOut = React.lazy(
() => import(/* webpackChunkName: "modules-traders-hub-logged-out" */ 'Modules/traders-hub-logged-out')
);
+const Wallets = React.lazy(() => import(/* webpackChunkName: "wallets" */ '@deriv/wallets'));
const Routes: React.FC = observer(() => {
const { client } = useStore();
const { is_logged_in, has_wallet } = client;
- const history = useHistory();
const title_TH = localize("Trader's Hub");
const title_TH_logged_out = localize('Deriv App');
- React.useLayoutEffect(() => {
- if (has_wallet) history.push(routes.wallets);
- }, [history, has_wallet]);
+ const componentToRender = () => {
+ if (is_logged_in) {
+ if (has_wallet) return Wallets;
+ return TradersHub;
+ }
+ return TradersHubLoggedOut;
+ };
return (
}>
(is_logged_in ? title_TH : title_TH_logged_out)}
/>
(
+
+);
+
+export default Page404;
diff --git a/packages/appstore/src/modules/Page404/Components/__tests__/Page404.spec.tsx b/packages/appstore/src/modules/Page404/Components/__tests__/Page404.spec.tsx
new file mode 100644
index 000000000000..9d334c1850fb
--- /dev/null
+++ b/packages/appstore/src/modules/Page404/Components/__tests__/Page404.spec.tsx
@@ -0,0 +1,19 @@
+import React from 'react';
+import { Router } from 'react-router';
+import { createBrowserHistory } from 'history';
+import { render, screen } from '@testing-library/react';
+import Page404 from '../Page404';
+
+describe('Page404', () => {
+ const browser_history = createBrowserHistory();
+
+ it('should render Page404', () => {
+ render(
+
+
+
+ );
+
+ expect(screen.getByText('We couldn’t find that page')).toBeInTheDocument();
+ });
+});
diff --git a/packages/appstore/src/modules/Page404/index.ts b/packages/appstore/src/modules/Page404/index.ts
new file mode 100644
index 000000000000..04dbb70feef6
--- /dev/null
+++ b/packages/appstore/src/modules/Page404/index.ts
@@ -0,0 +1,3 @@
+import Page404 from './Components/Page404';
+
+export default Page404;
diff --git a/packages/appstore/src/types/common.types.ts b/packages/appstore/src/types/common.types.ts
index 433c6e6070c8..01e97423af91 100644
--- a/packages/appstore/src/types/common.types.ts
+++ b/packages/appstore/src/types/common.types.ts
@@ -1,6 +1,5 @@
import { DetailsOfEachMT5Loginid } from '@deriv/api-types';
import { useStore } from '@deriv/stores';
-
import { PlatformIcons } from 'Assets/svgs/trading-platform';
import { RegionAvailability } from 'Constants/platform-config';
diff --git a/packages/components/src/components/icon/icons.js b/packages/components/src/components/icon/icons.js
index 76bf9c82a119..aed7b3089e82 100644
--- a/packages/components/src/components/icon/icons.js
+++ b/packages/components/src/components/icon/icons.js
@@ -22,6 +22,10 @@ import './appstore/ic-appstore-home.svg';
import './appstore/ic-appstore-information.svg';
import './appstore/ic-appstore-link-wallet.svg';
import './appstore/ic-appstore-linked-wallets.svg';
+import './appstore/ic-appstore-logged-out-eu-coins-desktop.svg';
+import './appstore/ic-appstore-logged-out-eu-coins-responsive.svg';
+import './appstore/ic-appstore-logged-out-non-eu-coins-desktop.svg';
+import './appstore/ic-appstore-logged-out-non-eu-coins-responsive.svg';
import './appstore/ic-appstore-menu-homepage.svg';
import './appstore/ic-appstore-multipliers-trade-type.svg';
import './appstore/ic-appstore-option-trade-type.svg';
@@ -34,6 +38,8 @@ import './appstore/ic-appstore-traders-hub-home.svg';
import './appstore/ic-appstore-trading-hub-beta.svg';
import './appstore/ic-appstore-trading-hub-onboarding-dark.svg';
import './appstore/ic-appstore-trading-hub-onboarding.svg';
+import './appstore/ic-appstore-trustpilot-logo.svg';
+import './appstore/ic-appstore-trustpilot-star.svg';
import './appstore/ic-appstore-wallet-aud-light.svg';
import './appstore/ic-appstore-wallet-bitcoin-light.svg';
import './appstore/ic-appstore-wallet-card-placeholder-dark-red-line.svg';
@@ -371,6 +377,7 @@ import './common/ic-demo-reset-balance-done.svg';
import './common/ic-demo-reset-balance.svg';
import './common/ic-demo.svg';
import './common/ic-deriv-outline.svg';
+import './common/ic-deriv-short-logo.svg';
import './common/ic-deriv.svg';
import './common/ic-desktop-outline.svg';
import './common/ic-desktop.svg';
diff --git a/packages/components/src/components/route-with-subroutes/route-with-subroutes.tsx b/packages/components/src/components/route-with-subroutes/route-with-subroutes.tsx
index f0aa214b0ac2..53c3686f7546 100644
--- a/packages/components/src/components/route-with-subroutes/route-with-subroutes.tsx
+++ b/packages/components/src/components/route-with-subroutes/route-with-subroutes.tsx
@@ -66,7 +66,7 @@ const RouteWithSubRoutes = ({
if (should_redirect_login) {
redirectToLogin(is_logged_in, language);
} else {
- result = ;
+ result = ;
}
} else {
const default_subroute = routes.find(r => r.default);
@@ -81,7 +81,7 @@ const RouteWithSubRoutes = ({
) : (
- {should_redirect ? : }
+ {should_redirect ? : }
)}
diff --git a/packages/core/src/App/AppContent.tsx b/packages/core/src/App/AppContent.tsx
index b5882cb80e57..df0a30c5f2c6 100644
--- a/packages/core/src/App/AppContent.tsx
+++ b/packages/core/src/App/AppContent.tsx
@@ -7,10 +7,8 @@ import { observer, useStore } from '@deriv/stores';
import { getLanguage } from '@deriv/translations';
import { Analytics } from '@deriv-com/analytics';
import { browserSupportsWebAuthn } from '@simplewebauthn/browser';
-
import BinaryBotIFrame from 'Modules/BinaryBotIFrame';
import SmartTraderIFrame from 'Modules/SmartTraderIFrame';
-
import ErrorBoundary from './Components/Elements/Errors/error-boundary.jsx';
import AppToastMessages from './Containers/app-toast-messages.jsx';
import AppContents from './Containers/Layout/app-contents.jsx';
diff --git a/packages/core/src/App/Components/Layout/Header/menu-link.tsx b/packages/core/src/App/Components/Layout/Header/menu-link.tsx
index 8963c754ae40..99d1ab8d6643 100644
--- a/packages/core/src/App/Components/Layout/Header/menu-link.tsx
+++ b/packages/core/src/App/Components/Layout/Header/menu-link.tsx
@@ -85,10 +85,8 @@ const MenuLink = observer(
}
if (is_cashier_link && is_virtual && !has_any_real_account) {
- const toggle_modal_routes = window.location.pathname === routes.root || traders_hub_path;
-
const handleClickCashier = () => {
- if (toggle_modal_routes) {
+ if (traders_hub_path) {
toggleReadyToDepositModal();
}
onClickLink?.();
diff --git a/packages/core/src/App/Components/Layout/Header/menu-links.jsx b/packages/core/src/App/Components/Layout/Header/menu-links.jsx
index db17c7c07bc9..1bc5efdcda79 100644
--- a/packages/core/src/App/Components/Layout/Header/menu-links.jsx
+++ b/packages/core/src/App/Components/Layout/Header/menu-links.jsx
@@ -46,9 +46,7 @@ const CashierTab = observer(() => {
const history = useHistory();
const toggle_modal_routes =
- window.location.pathname === routes.root ||
- window.location.pathname === routes.traders_hub ||
- window.location.pathname === routes.bot;
+ window.location.pathname === routes.traders_hub || window.location.pathname === routes.bot;
const toggleModal = () => {
if (toggle_modal_routes && !has_any_real_account) {
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 1e1ecda7769d..c3a9c564491f 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
@@ -66,7 +66,6 @@ const ToggleMenuDrawer = observer(({ platform_config }) => {
const is_trading_hub_category =
route.startsWith(routes.traders_hub) || route.startsWith(routes.cashier) || route.startsWith(routes.account);
- const is_wallets_category = route.startsWith(routes.wallets);
const isMounted = useIsMounted();
const { data } = useRemoteConfig(isMounted());
@@ -108,10 +107,10 @@ const ToggleMenuDrawer = observer(({ platform_config }) => {
const location = window.location.pathname;
- if (location === routes.traders_hub || is_trading_hub_category) {
- primary_routes = [routes.account, routes.cashier];
- } else if (has_wallet || location === routes.wallets) {
+ if (has_wallet && location === is_trading_hub_category) {
primary_routes = [routes.reports, routes.account];
+ } else if (location === is_trading_hub_category) {
+ primary_routes = [routes.account, routes.cashier];
} else {
primary_routes = [routes.reports, routes.account, routes.cashier];
}
@@ -313,7 +312,7 @@ const ToggleMenuDrawer = observer(({ platform_config }) => {
- {!is_trading_hub_category && !is_wallets_category && (
+ {!is_trading_hub_category && (
{
)}
@@ -349,14 +348,14 @@ const ToggleMenuDrawer = observer(({ platform_config }) => {
{is_logged_in && (
)}
- {!is_trading_hub_category && !is_wallets_category && (
+ {!is_trading_hub_category && (
})
);
-const Wallets = React.lazy(() =>
- moduleLoader(() => {
- // eslint-disable-next-line import/no-unresolved
- return import(/* webpackChunkName: "wallets" */ '@deriv/wallets');
- })
-);
-
const TradersHub = React.lazy(() =>
moduleLoader(() => {
// eslint-disable-next-line import/no-unresolved
@@ -283,12 +276,6 @@ const getModules = () => {
},
],
},
- {
- path: routes.wallets,
- component: Wallets,
- is_authenticated: true,
- getTitle: () => localize('Wallets'),
- },
{
path: routes.cashier_p2p_v2,
component: P2P_V2,
@@ -420,31 +407,18 @@ const getModules = () => {
],
},
{
- path: routes.onboarding,
+ path: routes.traders_hub,
component: AppStore,
- is_authenticated: false,
- getTitle: () => localize('Appstore'),
+ getTitle: () => localize("Trader's Hub"),
routes: [
- {
- path: routes.traders_hub,
- component: AppStore,
- getTitle: () => localize("Trader's Hub"),
- },
{
path: routes.onboarding,
component: AppStore,
- is_authenticated: false,
- getTitle: () => localize('Onboarding'),
+ is_authenticated: true,
+ getTitle: () => localize("Trader's Hub"),
},
],
},
- {
- path: routes.traders_hub,
- component: AppStore,
- exact: true,
- is_authenticated: false,
- getTitle: () => localize("Trader's Hub"),
- },
];
return modules;
@@ -458,7 +432,7 @@ const lazyLoadComplaintsPolicy = makeLazyLoader(
// Order matters
// TODO: search tag: test-route-parent-info -> Enable test for getting route parent info when there are nested routes
const initRoutesConfig = () => [
- { path: routes.index, component: RouterRedirect, getTitle: () => '', to: routes.root },
+ { path: routes.index, component: RouterRedirect, getTitle: () => '', to: routes.traders_hub },
{ path: routes.endpoint, component: Endpoint, getTitle: () => 'Endpoint' }, // doesn't need localization as it's for internal use
{ path: routes.redirect, component: Redirect, getTitle: () => localize('Redirect') },
{
diff --git a/packages/core/src/App/Containers/AccountSwitcherWallet/account-switcher-wallet-mobile.tsx b/packages/core/src/App/Containers/AccountSwitcherWallet/account-switcher-wallet-mobile.tsx
index 7320d0e593e1..d3c7810e6894 100644
--- a/packages/core/src/App/Containers/AccountSwitcherWallet/account-switcher-wallet-mobile.tsx
+++ b/packages/core/src/App/Containers/AccountSwitcherWallet/account-switcher-wallet-mobile.tsx
@@ -26,7 +26,7 @@ export const AccountSwitcherWalletMobile = observer(({ is_visible, toggle, login
const handleTradersHubRedirect = () => {
closeAccountsDialog();
- history.push(routes.wallets);
+ history.push(routes.traders_hub);
};
const handleManageFundsRedirect = () => {
diff --git a/packages/core/src/App/Containers/AccountSwitcherWallet/account-switcher-wallet.tsx b/packages/core/src/App/Containers/AccountSwitcherWallet/account-switcher-wallet.tsx
index 8ee7106952ce..8ed4182b10c1 100644
--- a/packages/core/src/App/Containers/AccountSwitcherWallet/account-switcher-wallet.tsx
+++ b/packages/core/src/App/Containers/AccountSwitcherWallet/account-switcher-wallet.tsx
@@ -40,7 +40,7 @@ export const AccountSwitcherWallet = observer(({ is_visible, toggle }: TAccountS
const handleTradersHubRedirect = async () => {
closeAccountsDialog();
- history.push(routes.wallets);
+ history.push(routes.traders_hub);
};
return (
diff --git a/packages/core/src/App/Containers/Layout/header/__tests__/default-mobile-links.spec.tsx b/packages/core/src/App/Containers/Layout/header/__tests__/default-mobile-links.spec.tsx
index ddc1a3b5aa11..d296523b38b1 100644
--- a/packages/core/src/App/Containers/Layout/header/__tests__/default-mobile-links.spec.tsx
+++ b/packages/core/src/App/Containers/Layout/header/__tests__/default-mobile-links.spec.tsx
@@ -1,31 +1,50 @@
import React from 'react';
+import { StoreProvider, mockStore } from '@deriv/stores';
+import { BrowserHistory, createBrowserHistory } from 'history';
+import { Router } from 'react-router';
import { render, screen } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import DefaultMobileLinks from '../default-mobile-links';
+import { useIsRealAccountNeededForCashier } from '@deriv/hooks';
+jest.mock('@deriv/hooks', () => ({
+ ...jest.requireActual('@deriv/hooks'),
+ useIsRealAccountNeededForCashier: jest.fn(() => false),
+}));
jest.mock('App/Components/Routes', () => ({
BinaryLink: jest.fn(() => MockedBinaryLink to Account Settings
),
}));
jest.mock('../show-notifications', () =>
jest.fn(() => MockedShowNotifications
)
);
-
jest.mock('../traders-hub-onboarding', () =>
jest.fn(() => MockedTradersHubOnboarding
)
);
-jest.mock('@deriv/stores', () => ({
- ...jest.requireActual('@deriv/stores'),
- useStore: jest.fn(() => ({ client: { has_wallet: false } })),
-}));
-
describe('DefaultMobileLinks', () => {
- const mock_props: React.ComponentProps = {
- handleClickCashier: jest.fn(),
+ let history: BrowserHistory, mock_store: ReturnType;
+
+ beforeEach(() => {
+ mock_store = mockStore({
+ client: { has_wallet: false, has_any_real_account: true, is_virtual: false },
+ ui: {
+ toggleNeedRealAccountForCashierModal: jest.fn(),
+ toggleReadyToDepositModal: jest.fn(),
+ },
+ });
+ history = createBrowserHistory();
+ });
+
+ const wrapper = ({ children }: { children: React.ReactNode }) => {
+ return (
+
+ {children}
+
+ );
};
it('should render "DefaultMobileLinks" with Onboarding, Notifications & link to Account Settings', () => {
- render();
+ render(, { wrapper });
expect(screen.getByTestId('dt_traders_hub_onboarding')).toBeInTheDocument();
expect(screen.getByText('MockedTradersHubOnboarding')).toBeInTheDocument();
expect(screen.getByText('MockedShowNotifications')).toBeInTheDocument();
@@ -33,13 +52,31 @@ describe('DefaultMobileLinks', () => {
});
it('should display the cashier button', () => {
- render();
+ render(, { wrapper });
expect(screen.getByRole('button', { name: 'Cashier' })).toBeInTheDocument();
});
- it('should fire the "handleClickCashier" event on clicking the button', () => {
- render();
- userEvent.click(screen.getByRole('button', { name: 'Cashier' }));
- expect(mock_props.handleClickCashier).toHaveBeenCalledTimes(1);
+ it('should trigger `toggleReadyToDepositModal` if user does not have any real account and active account is virtual', () => {
+ mock_store.client.has_any_real_account = false;
+ mock_store.client.is_virtual = true;
+ render(, { wrapper });
+ const cashierButton = screen.getByRole('button', { name: 'Cashier' });
+ userEvent.click(cashierButton);
+ expect(mock_store.ui.toggleReadyToDepositModal).toHaveBeenCalledTimes(1);
+ });
+
+ it('should trigger `toggleNeedRealAccountForCashierModal` if user does not have any real regulated account', () => {
+ (useIsRealAccountNeededForCashier as jest.Mock).mockReturnValueOnce(true);
+ render(, { wrapper });
+ const cashierButton = screen.getByRole('button', { name: 'Cashier' });
+ userEvent.click(cashierButton);
+ expect(mock_store.ui.toggleNeedRealAccountForCashierModal).toHaveBeenCalledTimes(1);
+ });
+
+ it('should navigate to `/cashier/deposit` if user has real account', () => {
+ render(, { wrapper });
+ const cashierButton = screen.getByRole('button', { name: 'Cashier' });
+ userEvent.click(cashierButton);
+ expect(history.location.pathname).toBe('/cashier/deposit');
});
});
diff --git a/packages/core/src/App/Containers/Layout/header/default-mobile-links.tsx b/packages/core/src/App/Containers/Layout/header/default-mobile-links.tsx
index 997fafba7116..e25924e50373 100644
--- a/packages/core/src/App/Containers/Layout/header/default-mobile-links.tsx
+++ b/packages/core/src/App/Containers/Layout/header/default-mobile-links.tsx
@@ -1,22 +1,38 @@
import React from 'react';
-
+import { useHistory } from 'react-router-dom';
import { Button, Icon } from '@deriv/components';
+import { useIsRealAccountNeededForCashier } from '@deriv/hooks';
import { routes } from '@deriv/shared';
import { useStore } from '@deriv/stores';
import { Localize } from '@deriv/translations';
-
import { BinaryLink } from 'App/Components/Routes';
-
import ShowNotifications from './show-notifications';
import TradersHubOnboarding from './traders-hub-onboarding';
-type TDefaultMobileLinks = {
- handleClickCashier: () => void;
-};
-
-const DefaultMobileLinks = React.memo(({ handleClickCashier }: TDefaultMobileLinks) => {
- const { client } = useStore();
- const { has_wallet } = client;
+const DefaultMobileLinks = React.memo(() => {
+ const { client, ui } = useStore();
+ const { has_any_real_account, has_wallet, is_virtual } = client;
+ const { toggleNeedRealAccountForCashierModal, toggleReadyToDepositModal } = ui;
+
+ const history = useHistory();
+
+ const real_account_needed_for_cashier = useIsRealAccountNeededForCashier();
+
+ const toggleModal = () => {
+ if (!has_any_real_account) {
+ toggleReadyToDepositModal();
+ } else if (history.location.pathname === routes.traders_hub) {
+ toggleNeedRealAccountForCashierModal();
+ }
+ };
+
+ const handleClickCashier = () => {
+ if ((!has_any_real_account && is_virtual) || real_account_needed_for_cashier) {
+ toggleModal();
+ } else {
+ history.push(routes.cashier_deposit);
+ }
+ };
return (
diff --git a/packages/core/src/App/Containers/Layout/header/header.tsx b/packages/core/src/App/Containers/Layout/header/header.tsx
index 3940b1f0e531..728a497bc5ea 100644
--- a/packages/core/src/App/Containers/Layout/header/header.tsx
+++ b/packages/core/src/App/Containers/Layout/header/header.tsx
@@ -42,7 +42,7 @@ const Header = observer(() => {
const { accounts, has_wallet, is_logged_in, setAccounts, loginid, switchAccount } = client;
const { pathname } = useLocation();
- const is_wallets_cashier_route = pathname.includes(routes.wallets_cashier);
+ const is_wallets_cashier_route = pathname.includes(routes.wallets);
const traders_hub_routes =
[
@@ -50,7 +50,6 @@ const Header = observer(() => {
routes.traders_hub_v2,
routes.account,
routes.cashier,
- routes.wallets,
routes.wallets_compare_accounts,
routes.compare_accounts,
routes.compare_cfds,
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 856621f73975..811ea292f3e7 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
@@ -1,8 +1,6 @@
import * as React from 'react';
import classNames from 'classnames';
-import { useHistory, useLocation } from 'react-router-dom';
import { DesktopWrapper, Icon, MobileWrapper, Popover, StaticUrl } from '@deriv/components';
-import { useIsRealAccountNeededForCashier } from '@deriv/hooks';
import { routes, platforms, formatMoney } from '@deriv/shared';
import { observer, useStore } from '@deriv/stores';
import { Localize } from '@deriv/translations';
@@ -12,7 +10,6 @@ import ToggleMenuDrawer from 'App/Components/Layout/Header/toggle-menu-drawer.js
import { BinaryLink } from 'App/Components/Routes';
import DerivBrandShortLogo from 'Assets/SvgComponents/header/deriv-logo-short.svg';
import RealAccountSignup from 'App/Containers/RealAccountSignup';
-import AccountInfo from 'App/Components/Layout/Header/account-info';
import SetAccountCurrencyModal from 'App/Containers/SetAccountCurrencyModal';
import CurrencySelectionModal from '../../CurrencySelectionModal';
import DefaultMobileLinks from './default-mobile-links';
@@ -25,25 +22,10 @@ type TPlatforms = typeof platforms;
const TradersHubHeaderWallets = observer(() => {
const { client, common, traders_hub, ui } = useStore();
- const { account_type, balance, currency, has_any_real_account, is_eu, is_logged_in, is_mt5_allowed, is_virtual } =
- client;
+ const { is_logged_in, is_mt5_allowed } = client;
const { platform } = common;
const { modal_data } = traders_hub;
- const {
- header_extension,
- is_accounts_switcher_on,
- is_app_disabled,
- is_route_modal_on,
- account_switcher_disabled_message,
- toggleAccountsDialog,
- toggleNeedRealAccountForCashierModal,
- toggleReadyToDepositModal,
- } = ui;
- const history = useHistory();
- const { pathname } = useLocation();
- const cashier_routes = pathname.startsWith(routes.cashier);
- const real_account_needed_for_cashier = useIsRealAccountNeededForCashier();
- const account_balance = formatMoney(currency, balance ?? '', true);
+ const { header_extension, is_app_disabled, is_route_modal_on } = ui;
const filterPlatformsForClients = (payload: TPlatformConfig) =>
payload.filter(config => {
@@ -53,22 +35,6 @@ const TradersHubHeaderWallets = observer(() => {
return true;
});
- const toggleModal = () => {
- if (!has_any_real_account) {
- toggleReadyToDepositModal();
- } else if (window.location.pathname === routes.traders_hub) {
- toggleNeedRealAccountForCashierModal();
- }
- };
-
- const handleClickCashier = () => {
- if ((!has_any_real_account && is_virtual) || real_account_needed_for_cashier) {
- toggleModal();
- } else {
- history.push(routes.cashier_deposit);
- }
- };
-
return (
{
{header_extension && is_logged_in && {header_extension}
}
-
+
@@ -124,21 +86,6 @@ const TradersHubHeaderWallets = observer(() => {
- {cashier_routes && (
-
- )}
@@ -146,28 +93,7 @@ const TradersHubHeaderWallets = observer(() => {
- {cashier_routes ? (
-
-
-
-
-
-
- ) : (
-
- )}
+
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 ae75d0320c2f..d221212dc8fc 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
@@ -1,8 +1,7 @@
import * as React from 'react';
import classNames from 'classnames';
-import { useHistory, useLocation } from 'react-router-dom';
+import { useLocation } from 'react-router-dom';
import { Icon, Popover, Loading } from '@deriv/components';
-import { useIsRealAccountNeededForCashier } from '@deriv/hooks';
import { routes, platforms, formatMoney, makeLazyLoader, moduleLoader } from '@deriv/shared';
import { observer, useStore } from '@deriv/stores';
import { Localize } from '@deriv/translations';
@@ -56,8 +55,7 @@ const CurrencySelectionModal = makeLazyLoader(
const TradersHubHeader = observer(() => {
const { client, common, traders_hub, ui } = useStore();
- const { account_type, balance, currency, has_any_real_account, is_eu, is_logged_in, is_mt5_allowed, is_virtual } =
- client;
+ const { account_type, balance, currency, is_eu, is_logged_in, is_mt5_allowed, is_virtual } = client;
const { platform } = common;
const { modal_data } = traders_hub;
const {
@@ -68,16 +66,12 @@ const TradersHubHeader = observer(() => {
is_route_modal_on,
account_switcher_disabled_message,
toggleAccountsDialog,
- toggleNeedRealAccountForCashierModal,
- toggleReadyToDepositModal,
is_real_acc_signup_on,
is_set_currency_modal_visible,
} = ui;
- const history = useHistory();
const { pathname } = useLocation();
const cashier_routes = pathname.startsWith(routes.cashier);
- const real_account_needed_for_cashier = useIsRealAccountNeededForCashier();
const account_balance = formatMoney(currency, balance ?? '', true);
const filterPlatformsForClients = (payload: TPlatformConfig) =>
@@ -88,22 +82,6 @@ const TradersHubHeader = observer(() => {
return true;
});
- const toggleModal = () => {
- if (!has_any_real_account) {
- toggleReadyToDepositModal();
- } else if (window.location.pathname === routes.traders_hub) {
- toggleNeedRealAccountForCashierModal();
- }
- };
-
- const handleClickCashier = () => {
- if ((!has_any_real_account && is_virtual) || real_account_needed_for_cashier) {
- toggleModal();
- } else {
- history.push(routes.cashier_deposit);
- }
- };
-
return (
) : (
-
+
)}
diff --git a/packages/core/src/App/Containers/Layout/header/traders-hub-home-button.tsx b/packages/core/src/App/Containers/Layout/header/traders-hub-home-button.tsx
index 08191f3590fc..d8b830f6ff87 100644
--- a/packages/core/src/App/Containers/Layout/header/traders-hub-home-button.tsx
+++ b/packages/core/src/App/Containers/Layout/header/traders-hub-home-button.tsx
@@ -26,9 +26,7 @@ const TradersHubHomeButton = observer(() => {
}
const redirectRoutes = () => {
- if (has_wallet) {
- return routes.wallets;
- } else if (is_next_tradershub_enabled) {
+ if (is_next_tradershub_enabled) {
return routes.traders_hub_v2;
}
return routes.traders_hub;
@@ -39,10 +37,7 @@ const TradersHubHomeButton = observer(() => {
data-testid='dt_traders_hub_home_button'
className={classNames('traders-hub-header__tradershub', {
'traders-hub-header__tradershub--active':
- pathname === routes.traders_hub ||
- pathname === routes.traders_hub_v2 ||
- pathname === routes.wallets ||
- pathname === routes.root,
+ pathname === routes.traders_hub || pathname === routes.traders_hub_v2,
})}
onClick={() => history.push(redirectRoutes())}
>
diff --git a/packages/core/src/App/Containers/Modals/wallets-upgrade-logout-modal/wallets-upgrade-logout-modal.tsx b/packages/core/src/App/Containers/Modals/wallets-upgrade-logout-modal/wallets-upgrade-logout-modal.tsx
index 05cef2cdd50f..bc579ffbda2c 100644
--- a/packages/core/src/App/Containers/Modals/wallets-upgrade-logout-modal/wallets-upgrade-logout-modal.tsx
+++ b/packages/core/src/App/Containers/Modals/wallets-upgrade-logout-modal/wallets-upgrade-logout-modal.tsx
@@ -17,7 +17,7 @@ const WalletsUpgradeLogoutModal = observer(() => {
onConfirm={() => {
localStorage.setItem('should_show_wallets_upgrade_completed_modal', 'true');
logout().then(() => {
- window.location.href = routes.wallets;
+ window.location.href = routes.traders_hub;
redirectToLogin(false, getLanguage());
});
}}
diff --git a/packages/core/src/App/Containers/NotificationsDialog/notification-list-wrapper.tsx b/packages/core/src/App/Containers/NotificationsDialog/notification-list-wrapper.tsx
index 63b25501e89b..216acd8b644c 100644
--- a/packages/core/src/App/Containers/NotificationsDialog/notification-list-wrapper.tsx
+++ b/packages/core/src/App/Containers/NotificationsDialog/notification-list-wrapper.tsx
@@ -17,14 +17,13 @@ const NotificationListWrapperForwardRef = React.forwardRef(
const { is_mobile } = ui;
const traders_hub = window.location.pathname === routes.traders_hub;
- const wallets_path = window.location.pathname.startsWith(routes.wallets);
return (
diff --git a/packages/core/src/App/Containers/Redirect/redirect.jsx b/packages/core/src/App/Containers/Redirect/redirect.jsx
index e5b6fe4dcb0d..c44ccef4b683 100644
--- a/packages/core/src/App/Containers/Redirect/redirect.jsx
+++ b/packages/core/src/App/Containers/Redirect/redirect.jsx
@@ -31,7 +31,7 @@ const Redirect = observer(() => {
const ext_platform_url = url_params.get('ext_platform_url');
const redirectToExternalPlatform = url => {
- history.push(`${routes.root}?ext_platform_url=${url}`);
+ history.push(`${routes.traders_hub}?ext_platform_url=${url}`);
redirected_to_route = true;
};
setVerificationCode(code_param, action_param);
@@ -94,28 +94,19 @@ const Redirect = observer(() => {
if (redirect_to) {
let pathname = '';
let hash = '';
- const main_screen_route = has_wallet ? routes.wallets : routes.traders_hub;
switch (redirect_to) {
case '1':
- pathname = routes.traders_hub;
- break;
- case '10':
- pathname = main_screen_route;
- hash = 'real';
- break;
- case '11':
- pathname = main_screen_route;
- hash = 'demo';
- break;
case '2':
pathname = routes.traders_hub;
break;
+ case '10':
case '20':
- pathname = main_screen_route;
+ pathname = routes.traders_hub;
hash = 'real';
break;
+ case '11':
case '21':
- pathname = main_screen_route;
+ pathname = routes.traders_hub;
hash = 'demo';
break;
case '3':
@@ -231,7 +222,7 @@ const Redirect = observer(() => {
const is_demo = localStorage.getItem('cfd_reset_password_intent')?.includes('demo');
if (has_wallet) {
history.push({
- pathname: routes.wallets,
+ pathname: routes.traders_hub,
search: url_query_string,
});
} else {
@@ -253,9 +244,9 @@ const Redirect = observer(() => {
break;
}
- if (!redirected_to_route && history.location.pathname !== routes.root) {
+ if (!redirected_to_route && history.location.pathname !== routes.traders_hub) {
history.push({
- pathname: routes.root,
+ pathname: routes.traders_hub,
search: url_query_string,
});
}
diff --git a/packages/core/src/Stores/client-store.js b/packages/core/src/Stores/client-store.js
index 84c9cffd00ea..5d831b4f776a 100644
--- a/packages/core/src/Stores/client-store.js
+++ b/packages/core/src/Stores/client-store.js
@@ -1947,7 +1947,7 @@ export default class ClientStore extends BaseStore {
}
//temporary workaround to sync this.loginid with selected wallet loginid
- if (window.location.pathname.includes(routes.wallets_cashier)) {
+ if (window.location.pathname.includes(routes.wallets)) {
this.resetLocalStorageValues(localStorage.getItem('active_loginid') ?? this.loginid);
return;
}
@@ -2192,7 +2192,7 @@ export default class ClientStore extends BaseStore {
const redirect_url = sessionStorage.getItem('redirect_url');
- const target_url = this.has_wallet ? routes.wallets : routes.traders_hub;
+ const target_url = routes.traders_hub;
if (
(redirect_url?.endsWith(routes.trade) ||
diff --git a/packages/shared/src/utils/routes/routes.ts b/packages/shared/src/utils/routes/routes.ts
index ef0422d85d85..fc1f526bb3d6 100644
--- a/packages/shared/src/utils/routes/routes.ts
+++ b/packages/shared/src/utils/routes/routes.ts
@@ -37,7 +37,6 @@ export const routes = {
positions: '/reports/positions',
profit: '/reports/profit',
reports: '/reports',
- root: '/',
reset_password: '/',
redirect: '/redirect',
settings: '/settings',
@@ -77,13 +76,14 @@ export const routes = {
compare_cfds: '/cfd-compare-acccounts',
// Wallets
- wallets: '/wallets',
- wallets_cashier: '/wallets/cashier',
- wallets_deposit: '/wallets/cashier/deposit',
- wallets_withdrawal: '/wallets/cashier/withdraw',
- wallets_transfer: 'wallets/cashier/transfer',
- wallets_transactions: '/wallets/cashier/transactions',
- wallets_compare_accounts: '/wallets/compare-accounts',
+ wallets: '/wallet',
+ wallets_deposit: '/wallet/deposit',
+ wallets_withdrawal: '/wallet/withdrawal',
+ wallets_transfer: 'wallet/account-transfer',
+ wallets_transactions: '/wallet/transactions',
+ wallets_compare_accounts: '/compare-accounts',
+ wallets_on_ramp: '/wallet/on-ramp',
+ wallets_reset_balance: '/wallet/reset-balance',
// Traders Hub
traders_hub_v2: '/traders-hub',
diff --git a/packages/stores/types.ts b/packages/stores/types.ts
index b0e067cfde49..a60fd573082e 100644
--- a/packages/stores/types.ts
+++ b/packages/stores/types.ts
@@ -89,7 +89,14 @@ type TRoutes =
| '/appstore'
| '/appstore/traders-hub'
| '/appstore/onboarding'
- | '/wallets';
+ | '/wallet'
+ | '/wallet/deposit'
+ | '/wallet/withdrawal'
+ | '/wallet/account-transfer'
+ | '/wallet/reset-balance'
+ | '/wallet/transactions'
+ | '/wallet/on-ramp'
+ | '/compare-accounts';
type TPopulateSettingsExtensionsMenuItem = {
icon: string;
diff --git a/packages/wallets/component-tests/crypto-payment-redirection.spec.tsx b/packages/wallets/component-tests/crypto-payment-redirection.spec.tsx
index 03a75577901a..72b328bb5bbf 100644
--- a/packages/wallets/component-tests/crypto-payment-redirection.spec.tsx
+++ b/packages/wallets/component-tests/crypto-payment-redirection.spec.tsx
@@ -28,14 +28,14 @@ test.describe('Wallets - Crypto withdrawal', () => {
},
});
- await page.goto(`${baseURL}/wallets`);
+ await page.goto(`${baseURL}/`);
await page.click('.wallets-textfield__field--listcard');
await page.click('#downshift-0-item-1');
});
test('render withdrawal form with all elements', async ({ baseURL, page }) => {
- await page.goto(`${baseURL}/wallets/cashier/withdraw?verification=XXXX`);
+ await page.goto(`${baseURL}/wallet/withdrawal?verification=XXXX`);
// #cryptoAddress
await expect(page.locator('#cryptoAddress')).toBeVisible();
@@ -59,7 +59,7 @@ test.describe('Wallets - Crypto withdrawal', () => {
});
test('displays validation messages for address field', async ({ baseURL, page }) => {
- await page.goto(`${baseURL}/wallets/cashier/withdraw?verification=XXXX`);
+ await page.goto(`${baseURL}/wallet/withdrawal?verification=XXXX`);
// given initial state, no validation message should be visible
let validationMessage = await page.locator('text=This field is required.');
@@ -85,7 +85,7 @@ test.describe('Wallets - Crypto withdrawal', () => {
});
test('balance meter is empty initially', async ({ baseURL, page }) => {
- await page.goto(`${baseURL}/wallets/cashier/withdraw?verification=XXXX`);
+ await page.goto(`${baseURL}/wallet/withdrawal?verification=XXXX`);
// percentage selector, visible
await expect(page.locator('.wallets-percentage-selector')).toBeVisible();
@@ -119,7 +119,7 @@ test.describe('Wallets - Crypto withdrawal', () => {
baseURL,
page,
}) => {
- await page.goto(`${baseURL}/wallets/cashier/withdraw?verification=XXXX`);
+ await page.goto(`${baseURL}/wallet/withdrawal?verification=XXXX`);
// percentage selector, visible
await expect(page.locator('.wallets-percentage-selector')).toBeVisible();
@@ -156,7 +156,7 @@ test.describe('Wallets - Crypto withdrawal', () => {
baseURL,
page,
}) => {
- await page.goto(`${baseURL}/wallets/cashier/withdraw?verification=XXXX`);
+ await page.goto(`${baseURL}/wallet/withdrawal?verification=XXXX`);
// percentage selector, visible
await expect(page.locator('.wallets-percentage-selector')).toBeVisible();
@@ -190,7 +190,7 @@ test.describe('Wallets - Crypto withdrawal', () => {
});
test('balance meter displays still displays 100% when amount exceeds balance', async ({ baseURL, page }) => {
- await page.goto(`${baseURL}/wallets/cashier/withdraw?verification=XXXX`);
+ await page.goto(`${baseURL}/wallet/withdrawal?verification=XXXX`);
// percentage selector, visible
await expect(page.locator('.wallets-percentage-selector')).toBeVisible();
@@ -224,7 +224,7 @@ test.describe('Wallets - Crypto withdrawal', () => {
});
test('validates crypto input against current balance and minimum withdrawal amount', async ({ baseURL, page }) => {
- await page.goto(`${baseURL}/wallets/cashier/withdraw?verification=XXXX`);
+ await page.goto(`${baseURL}/wallet/withdrawal?verification=XXXX`);
// given initial state, no validation message should be shown
await expect(
@@ -283,7 +283,7 @@ test.describe('Wallets - Crypto withdrawal', () => {
});
test('converts fiat to crypto and vice versa', async ({ baseURL, page }) => {
- await page.goto(`${baseURL}/wallets/cashier/withdraw?verification=XXXX`);
+ await page.goto(`${baseURL}/wallet/withdrawal?verification=XXXX`);
// given some amount of crypto being put to input, convert it to fiat
await page.fill('#cryptoAmount', '10');
@@ -295,7 +295,7 @@ test.describe('Wallets - Crypto withdrawal', () => {
});
test('submit button validity', async ({ baseURL, page }) => {
- await page.goto(`${baseURL}/wallets/cashier/withdraw?verification=XXXX`);
+ await page.goto(`${baseURL}/wallet/withdrawal?verification=XXXX`);
// given initial state, submit button should be disabled
await expect(page.locator('.wallets-withdrawal-crypto-form__submit button[type="submit"]')).toBeDisabled();
@@ -318,7 +318,7 @@ test.describe('Wallets - Crypto withdrawal', () => {
});
test('spinner while submitting', async ({ baseURL, page }) => {
- await page.goto(`${baseURL}/wallets/cashier/withdraw?verification=XXXX`);
+ await page.goto(`${baseURL}/wallet/withdrawal?verification=XXXX`);
// given initial state, submit button should be disabled
await expect(page.locator('.wallets-withdrawal-crypto-form__submit button[type="submit"]')).toBeDisabled();
diff --git a/packages/wallets/component-tests/menu.spec.tsx b/packages/wallets/component-tests/menu.spec.tsx
index 75a62da3d268..a74e7d66eb95 100644
--- a/packages/wallets/component-tests/menu.spec.tsx
+++ b/packages/wallets/component-tests/menu.spec.tsx
@@ -24,7 +24,7 @@ test.describe('Wallets - Traders Hub', () => {
accounts: DEFAULT_WALLET_ACCOUNTS,
},
});
- await page.goto(`${baseURL}/wallets`);
+ await page.goto(`${baseURL}/`);
const balanceContainer = await page.textContent('.wallets-balance__container');
expect(balanceContainer).toContain('9,988,000.89 USD');
diff --git a/packages/wallets/component-tests/wallets-carousel-content.spec.tsx b/packages/wallets/component-tests/wallets-carousel-content.spec.tsx
index 8b14c9269d96..91308afff67e 100644
--- a/packages/wallets/component-tests/wallets-carousel-content.spec.tsx
+++ b/packages/wallets/component-tests/wallets-carousel-content.spec.tsx
@@ -57,7 +57,7 @@ test.describe('Wallets - Mobile carousel', () => {
});
test('renders cards for all wallets', async ({ baseURL }) => {
- await mobilePage.goto(`${baseURL}/wallets`);
+ await mobilePage.goto(`${baseURL}/`);
// Ensure the carousel is loaded and visible
await mobilePage.waitForSelector(CAROUSEL_SELECTOR);
@@ -90,7 +90,7 @@ test.describe('Wallets - Mobile carousel', () => {
});
test('renders progress bar with active item and updates it when swiping', async ({ baseURL }) => {
- await mobilePage.goto(`${baseURL}/wallets`);
+ await mobilePage.goto(`${baseURL}/`);
const activeProgressBarItem = mobilePage.locator('.wallets-progress-bar div:nth-child(1)');
const progressBarItemClass = await activeProgressBarItem.getAttribute('class');
@@ -117,7 +117,7 @@ test.describe('Wallets - Mobile carousel', () => {
test('switches account when clicking on progress bar', async ({ baseURL }) => {
// given
- await mobilePage.goto(`${baseURL}/wallets`);
+ await mobilePage.goto(`${baseURL}/`);
const progressBarItem = mobilePage.locator('.wallets-progress-bar div:nth-child(3)');
diff --git a/packages/wallets/src/components/DerivAppsSection/DerivAppsSuccessFooter.tsx b/packages/wallets/src/components/DerivAppsSection/DerivAppsSuccessFooter.tsx
index fc576c15f735..d6221522bbed 100644
--- a/packages/wallets/src/components/DerivAppsSection/DerivAppsSuccessFooter.tsx
+++ b/packages/wallets/src/components/DerivAppsSection/DerivAppsSuccessFooter.tsx
@@ -18,7 +18,7 @@ const DerivAppsSuccessFooter = () => {
{
- history.push('/wallets/cashier/transfer');
+ history.push('/wallet/account-transfer');
hide();
}}
size='lg'
diff --git a/packages/wallets/src/components/DerivAppsSection/DerivAppsTradingAccount.tsx b/packages/wallets/src/components/DerivAppsSection/DerivAppsTradingAccount.tsx
index 16bfc88928f4..3c123808796f 100644
--- a/packages/wallets/src/components/DerivAppsSection/DerivAppsTradingAccount.tsx
+++ b/packages/wallets/src/components/DerivAppsSection/DerivAppsTradingAccount.tsx
@@ -39,8 +39,8 @@ const DerivAppsTradingAccount: React.FC = () => {
className='wallets-deriv-apps-section__button'
onClick={() => {
activeWallet?.is_virtual
- ? history.push('/wallets/cashier/reset-balance')
- : history.push('/wallets/cashier/transfer', {
+ ? history.push('/wallet/reset-balance')
+ : history.push('/wallet/account-transfer', {
toAccountLoginId: activeLinkedToTradingAccount?.loginid,
});
}}
diff --git a/packages/wallets/src/components/WalletListCardActions/WalletListCardActions.tsx b/packages/wallets/src/components/WalletListCardActions/WalletListCardActions.tsx
index 4cf78bc0d3fa..234c82e9cd8b 100644
--- a/packages/wallets/src/components/WalletListCardActions/WalletListCardActions.tsx
+++ b/packages/wallets/src/components/WalletListCardActions/WalletListCardActions.tsx
@@ -25,7 +25,7 @@ const getWalletHeaderButtons = (isDemo?: boolean) => {
className: 'wallets-mobile-actions-content-icon',
color: 'white',
icon: ,
- name: 'withdraw',
+ name: 'withdrawal',
text: 'Withdraw',
variant: 'outlined',
},
@@ -33,22 +33,16 @@ const getWalletHeaderButtons = (isDemo?: boolean) => {
className: 'wallets-mobile-actions-content-icon',
color: 'white',
icon: ,
- name: 'transfer',
+ name: 'account-transfer',
text: 'Transfer',
variant: 'outlined',
},
] as const;
// Filter out the "Withdraw" button when is_demo is true
- const filteredButtons = isDemo ? buttons.filter(button => button.name !== 'withdraw') : buttons;
+ const filteredButtons = isDemo ? buttons.filter(button => button.name !== 'withdrawal') : buttons;
- const orderForDemo = ['reset-balance', 'transfer'];
-
- const sortedButtons = isDemo
- ? [...filteredButtons].sort((a, b) => orderForDemo.indexOf(a.name) - orderForDemo.indexOf(b.name))
- : filteredButtons;
-
- return sortedButtons;
+ return filteredButtons;
};
const WalletListCardActions = () => {
@@ -71,7 +65,7 @@ const WalletListCardActions = () => {
color={button.color}
icon={button.icon}
onClick={() => {
- history.push(`/wallets/cashier/${button.name}`);
+ history.push(`/wallet/${button.name}`);
}}
size='lg'
/>
@@ -92,7 +86,7 @@ const WalletListCardActions = () => {
icon={button.icon}
key={button.name}
onClick={() => {
- history.push(`/wallets/cashier/${button.name}`);
+ history.push(`/wallet/${button.name}`);
}}
rounded='lg'
variant={button.variant}
diff --git a/packages/wallets/src/components/WalletListCardActions/__tests__/WalletListCardActions.spec.tsx b/packages/wallets/src/components/WalletListCardActions/__tests__/WalletListCardActions.spec.tsx
index 2c1c9c9ce3de..9e98469c48ec 100644
--- a/packages/wallets/src/components/WalletListCardActions/__tests__/WalletListCardActions.spec.tsx
+++ b/packages/wallets/src/components/WalletListCardActions/__tests__/WalletListCardActions.spec.tsx
@@ -90,7 +90,7 @@ describe('WalletListCardActions', () => {
render(, { wrapper });
screen.getByRole('button', { name: 'deposit' }).click();
- expect(history.location.pathname).toBe('/wallets/cashier/deposit');
+ expect(history.location.pathname).toBe('/wallet/deposit');
});
it('should render the actions for mobile', () => {
@@ -109,25 +109,25 @@ describe('WalletListCardActions', () => {
wrapper,
});
screen.getByRole('button', { name: 'deposit' }).click();
- expect(history.location.pathname).toBe('/wallets/cashier/deposit');
+ expect(history.location.pathname).toBe('/wallet/deposit');
});
it('should redirect to cashier page when clicking on deposit', () => {
render(, { wrapper });
screen.getByRole('button', { name: 'deposit' }).click();
- expect(history.location.pathname).toBe('/wallets/cashier/deposit');
+ expect(history.location.pathname).toBe('/wallet/deposit');
});
it('should redirect to cashier page when clicking on withdraw', () => {
render(, { wrapper });
- screen.getByRole('button', { name: 'withdraw' }).click();
- expect(history.location.pathname).toBe('/wallets/cashier/withdraw');
+ screen.getByRole('button', { name: 'withdrawal' }).click();
+ expect(history.location.pathname).toBe('/wallet/withdrawal');
});
it('should redirect to cashier page when clicking on transfer', () => {
render(, { wrapper });
- screen.getByRole('button', { name: 'transfer' }).click();
- expect(history.location.pathname).toBe('/wallets/cashier/transfer');
+ screen.getByRole('button', { name: 'account-transfer' }).click();
+ expect(history.location.pathname).toBe('/wallet/account-transfer');
});
it('should redirect to cashier page when clicking on reset balance', () => {
@@ -144,6 +144,6 @@ describe('WalletListCardActions', () => {
render(, { wrapper });
screen.getByRole('button', { name: 'reset-balance' }).click();
- expect(history.location.pathname).toBe('/wallets/cashier/reset-balance');
+ expect(history.location.pathname).toBe('/wallet/reset-balance');
});
});
diff --git a/packages/wallets/src/components/WalletNoWalletFoundState/WalletNoWalletFoundState.scss b/packages/wallets/src/components/WalletNoWalletFoundState/WalletNoWalletFoundState.scss
deleted file mode 100644
index 9ee90447a9b7..000000000000
--- a/packages/wallets/src/components/WalletNoWalletFoundState/WalletNoWalletFoundState.scss
+++ /dev/null
@@ -1,40 +0,0 @@
-.wallets-no-wallet-found-state {
- width: 100%;
- height: calc(100vh - 84px);
- display: flex;
- align-items: center;
- justify-content: center;
- gap: 0.5rem;
- background: var(--system-light-8-primary-background, #fff);
-
- @include mobile {
- height: calc(100vh - 44px);
- flex-direction: column;
- }
-
- &__container {
- display: flex;
- flex-direction: column;
- align-items: start;
- gap: 4rem;
- padding-inline: 0.5rem;
-
- @include mobile {
- align-items: center;
- }
- }
-
- &__content {
- display: flex;
- flex-direction: column;
- gap: 1rem;
-
- @include mobile {
- align-items: center;
- }
- }
-
- &__emphasized-text {
- color: var(--brand-coral, #ff444f);
- }
-}
diff --git a/packages/wallets/src/components/WalletNoWalletFoundState/WalletNoWalletFoundState.tsx b/packages/wallets/src/components/WalletNoWalletFoundState/WalletNoWalletFoundState.tsx
deleted file mode 100644
index 9c5b8a3da665..000000000000
--- a/packages/wallets/src/components/WalletNoWalletFoundState/WalletNoWalletFoundState.tsx
+++ /dev/null
@@ -1,33 +0,0 @@
-import React from 'react';
-import { useHistory } from 'react-router-dom';
-import useDevice from '../../hooks/useDevice';
-import NoWalletIcon from '../../public/images/no-wallet.svg';
-import { WalletButton, WalletText } from '../Base';
-import './WalletNoWalletFoundState.scss';
-
-const WalletNoWalletFoundState: React.FC = () => {
- const { isMobile } = useDevice();
- const history = useHistory();
-
- return (
-
-
-
-
-
- You have no wallet account 🐣
-
-
- Disable the next_wallet{' '}
- feature flag to see Trader's Hub.
-
-
-
history.push('/endpoint')} size='lg'>
- Endpoint
-
-
-
- );
-};
-
-export default WalletNoWalletFoundState;
diff --git a/packages/wallets/src/components/WalletNoWalletFoundState/index.ts b/packages/wallets/src/components/WalletNoWalletFoundState/index.ts
deleted file mode 100644
index 2d5186e3af2c..000000000000
--- a/packages/wallets/src/components/WalletNoWalletFoundState/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export { default as WalletNoWalletFoundState } from './WalletNoWalletFoundState';
diff --git a/packages/wallets/src/components/WalletsAddMoreCardBanner/WalletsAddMoreCardBanner.tsx b/packages/wallets/src/components/WalletsAddMoreCardBanner/WalletsAddMoreCardBanner.tsx
index 056166d1645c..7b2bff25d297 100644
--- a/packages/wallets/src/components/WalletsAddMoreCardBanner/WalletsAddMoreCardBanner.tsx
+++ b/packages/wallets/src/components/WalletsAddMoreCardBanner/WalletsAddMoreCardBanner.tsx
@@ -31,7 +31,7 @@ const WalletsAddMoreCardBanner: React.FC = ({
modal.hide()} variant='outlined'>
Maybe later
- history.push('/wallets/cashier/deposit')}>Deposit now
+ history.push('/wallet/deposit')}>Deposit now
),
[history] // eslint-disable-line react-hooks/exhaustive-deps
@@ -57,7 +57,7 @@ const WalletsAddMoreCardBanner: React.FC = ({
displayBalance={data?.display_balance ?? `0.00 ${data?.currency}`}
landingCompany={data?.landing_company_shortcode}
onPrimaryButtonClick={() => {
- history.push('/wallets/cashier/deposit');
+ history.push('/wallet/deposit');
modal.hide();
}}
onSecondaryButtonClick={() => modal.hide()}
diff --git a/packages/wallets/src/components/WalletsCarouselContent/WalletsCarouselContent.tsx b/packages/wallets/src/components/WalletsCarouselContent/WalletsCarouselContent.tsx
index ce1ad722a5a2..7e9d17de5f30 100644
--- a/packages/wallets/src/components/WalletsCarouselContent/WalletsCarouselContent.tsx
+++ b/packages/wallets/src/components/WalletsCarouselContent/WalletsCarouselContent.tsx
@@ -116,9 +116,7 @@ const WalletsCarouselContent: React.FC = ({ onWalletSettled }) => {
walletsCarouselEmblaApi?.scrollTo(index);
walletAccountsList && setSelectedLoginId(walletAccountsList[index].loginid);
account.is_active &&
- (account.is_virtual
- ? history.push('/wallets/cashier/reset-balance')
- : history.push('/wallets/cashier/deposit'));
+ (account.is_virtual ? history.push('/wallet/reset-balance') : history.push('/wallet/deposit'));
},
[walletsCarouselEmblaApi, walletAccountsList, history]
);
diff --git a/packages/wallets/src/components/WalletsCarouselHeader/WalletsCarouselHeader.tsx b/packages/wallets/src/components/WalletsCarouselHeader/WalletsCarouselHeader.tsx
index fa4e91cc63a3..c3c4091734c5 100644
--- a/packages/wallets/src/components/WalletsCarouselHeader/WalletsCarouselHeader.tsx
+++ b/packages/wallets/src/components/WalletsCarouselHeader/WalletsCarouselHeader.tsx
@@ -44,7 +44,7 @@ const WalletsCarouselHeader: React.FC = ({ balance, currency, hidden, is
icon={}
iconSize='lg'
onClick={() => {
- history.push(`/wallets/cashier/transfer`);
+ history.push('/wallet/account-transfer');
}}
size='lg'
/>
diff --git a/packages/wallets/src/components/WalletsCarouselHeader/__tests__/WalletsCarouselHeader.spec.tsx b/packages/wallets/src/components/WalletsCarouselHeader/__tests__/WalletsCarouselHeader.spec.tsx
index 4085cc6afaab..1f340cde6fb2 100644
--- a/packages/wallets/src/components/WalletsCarouselHeader/__tests__/WalletsCarouselHeader.spec.tsx
+++ b/packages/wallets/src/components/WalletsCarouselHeader/__tests__/WalletsCarouselHeader.spec.tsx
@@ -37,7 +37,7 @@ describe('WalletsCarouselHeader', () => {
fireEvent.click(screen.getByTestId('dt_wallets_carousel_header_button'));
- expect(useHistory().push).toHaveBeenCalledWith('/wallets/cashier/transfer');
+ expect(useHistory().push).toHaveBeenCalledWith('/wallet/account-transfer');
});
it('should display loader when balance is loading', () => {
diff --git a/packages/wallets/src/components/index.ts b/packages/wallets/src/components/index.ts
index c2c50482009d..748bd2fcf6f3 100644
--- a/packages/wallets/src/components/index.ts
+++ b/packages/wallets/src/components/index.ts
@@ -29,7 +29,6 @@ export * from './WalletListCardDetails';
export * from './WalletListCardDropdown';
export * from './WalletListHeader';
export * from './WalletMarketIcon';
-export * from './WalletNoWalletFoundState';
export * from './WalletsActionScreen';
export * from './WalletsAddMoreCarousel';
export * from './WalletsAppLinkedWithWalletIcon';
diff --git a/packages/wallets/src/features/cashier/components/WalletCashierContent/WalletCashierContent.tsx b/packages/wallets/src/features/cashier/components/WalletCashierContent/WalletCashierContent.tsx
index ca90607ead0e..44a5717f27da 100644
--- a/packages/wallets/src/features/cashier/components/WalletCashierContent/WalletCashierContent.tsx
+++ b/packages/wallets/src/features/cashier/components/WalletCashierContent/WalletCashierContent.tsx
@@ -11,17 +11,17 @@ import { CashierLocked, DepositLocked, WithdrawalLocked } from '../../modules';
const WalletCashierContent = () => {
const history = useHistory();
- const isDeposit = useRouteMatch('/wallets/cashier/deposit');
- const isFiatOnRamp = useRouteMatch('/wallets/cashier/on-ramp');
- const isResetBalance = useRouteMatch('/wallets/cashier/reset-balance');
- const isTransfer = useRouteMatch('/wallets/cashier/transfer');
- const isTransactions = useRouteMatch('/wallets/cashier/transactions');
- const isWithdraw = useRouteMatch('/wallets/cashier/withdraw');
+ const isDeposit = useRouteMatch('/wallet/deposit');
+ const isFiatOnRamp = useRouteMatch('/wallet/on-ramp');
+ const isResetBalance = useRouteMatch('/wallet/reset-balance');
+ const isTransfer = useRouteMatch('/wallet/account-transfer');
+ const isTransactions = useRouteMatch('/wallet/transactions');
+ const isWithdraw = useRouteMatch('/wallet/withdrawal');
useEffect(() => {
// redirect to deposit page if no other page is matched
if (!isTransfer && !isDeposit && !isTransactions && !isWithdraw && !isResetBalance && !isFiatOnRamp) {
- history.push('/wallets/cashier/deposit');
+ history.push('/wallet/deposit');
}
}, [isTransfer, isDeposit, isTransactions, isWithdraw, isResetBalance, isFiatOnRamp, history]);
diff --git a/packages/wallets/src/features/cashier/components/WalletCashierHeader/WalletCashierHeader.tsx b/packages/wallets/src/features/cashier/components/WalletCashierHeader/WalletCashierHeader.tsx
index 858dee726e32..8028842574fe 100644
--- a/packages/wallets/src/features/cashier/components/WalletCashierHeader/WalletCashierHeader.tsx
+++ b/packages/wallets/src/features/cashier/components/WalletCashierHeader/WalletCashierHeader.tsx
@@ -28,12 +28,12 @@ const realAccountTabs = [
},
{
icon: ,
- path: 'withdraw',
+ path: 'withdrawal',
text: i18n.t('Withdraw'),
},
{
icon: ,
- path: 'transfer',
+ path: 'account-transfer',
text: i18n.t('Transfer'),
},
{
@@ -44,16 +44,16 @@ const realAccountTabs = [
] as const;
const virtualAccountTabs = [
- {
- icon: ,
- path: 'transfer',
- text: i18n.t('Transfer'),
- },
{
icon: ,
path: 'reset-balance',
text: i18n.t('Reset Balance'),
},
+ {
+ icon: ,
+ path: 'account-transfer',
+ text: i18n.t('Transfer'),
+ },
{
icon: ,
path: 'transactions',
@@ -131,23 +131,23 @@ const WalletCashierHeader: React.FC = ({ hideWalletDetails }) => {
'wallets-cashier-header__close-icon--white': activeWallet?.is_virtual,
})}
iconSize='xs'
- onClick={() => history.push('/wallets')}
+ onClick={() => history.push('/')}
/>
{tabs.map(tab => {
const isActiveTab =
- location.pathname === `/wallets/cashier/on-ramp`
+ location.pathname === `/wallet/on-ramp`
? tab.path === 'deposit'
- : location.pathname === `/wallets/cashier/${tab.path}`;
+ : location.pathname === `/wallet/${tab.path}`;
return (