From 28c3eb0a514ab8a1c62dd2eedc2ecbb3b36d5614 Mon Sep 17 00:00:00 2001
From: lubega-deriv <142860499+lubega-deriv@users.noreply.github.com>
Date: Mon, 2 Dec 2024 14:06:02 +0800
Subject: [PATCH] fix: demo create success modal content (#17557)
---
.../cfd/modals/CTraderSuccessModal/CTraderSuccessModal.tsx | 2 +-
.../DxtradeEnterPasswordModal.tsx | 2 +-
.../cfd/modals/MT5AccountAdded/MT5AccountAdded.tsx | 7 +++++--
.../MT5AccountAdded/__tests__/MT5AccountAdded.spec.tsx | 4 ++--
4 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/packages/wallets/src/features/cfd/modals/CTraderSuccessModal/CTraderSuccessModal.tsx b/packages/wallets/src/features/cfd/modals/CTraderSuccessModal/CTraderSuccessModal.tsx
index 8e217a2b4334..aee382a3a2c0 100644
--- a/packages/wallets/src/features/cfd/modals/CTraderSuccessModal/CTraderSuccessModal.tsx
+++ b/packages/wallets/src/features/cfd/modals/CTraderSuccessModal/CTraderSuccessModal.tsx
@@ -27,7 +27,7 @@ const CTraderSuccessModal = ({ createdAccount, isDemo, walletCurrencyType }: TCT
if (isLoading) return ;
const description = isDemo
- ? localize("Let's practise trading with {{ctraderBalance}} virtual funds.", {
+ ? localize('Practise trading with {{ctraderBalance}} virtual funds.', {
ctraderBalance: cTraderAccount.display_balance,
})
: localize(
diff --git a/packages/wallets/src/features/cfd/modals/DxtradeEnterPasswordModal/DxtradeEnterPasswordModal.tsx b/packages/wallets/src/features/cfd/modals/DxtradeEnterPasswordModal/DxtradeEnterPasswordModal.tsx
index 37a81c7bd6a4..aa2f6c414038 100644
--- a/packages/wallets/src/features/cfd/modals/DxtradeEnterPasswordModal/DxtradeEnterPasswordModal.tsx
+++ b/packages/wallets/src/features/cfd/modals/DxtradeEnterPasswordModal/DxtradeEnterPasswordModal.tsx
@@ -64,7 +64,7 @@ const DxtradeEnterPasswordModal = () => {
const successDescription = useMemo(() => {
return accountType === 'demo'
- ? localize("Let's practise trading with {{dxtradeBalance}} virtual funds.", { dxtradeBalance })
+ ? localize('Practise trading with {{dxtradeBalance}} virtual funds.', { dxtradeBalance })
: localize(
'Transfer funds from your {{currency}} Wallet to your {{dxtradeTitle}} account to start trading.',
{ currency: activeWallet?.currency, dxtradeTitle: PlatformDetails.dxtrade.title }
diff --git a/packages/wallets/src/features/cfd/modals/MT5AccountAdded/MT5AccountAdded.tsx b/packages/wallets/src/features/cfd/modals/MT5AccountAdded/MT5AccountAdded.tsx
index 844efe31c242..ece350fe9a40 100644
--- a/packages/wallets/src/features/cfd/modals/MT5AccountAdded/MT5AccountAdded.tsx
+++ b/packages/wallets/src/features/cfd/modals/MT5AccountAdded/MT5AccountAdded.tsx
@@ -102,7 +102,7 @@ const MT5AccountAdded: FC = ({ account, marketType, platform, product })
const renderSuccessDescription = useMemo(() => {
if (isDemo) {
- return localize("Let's practise trading with {{accountBalance}} virtual funds.", {
+ return localize('Practise trading with {{accountBalance}} virtual funds.', {
accountBalance: addedAccount?.display_balance,
});
}
@@ -136,7 +136,10 @@ const MT5AccountAdded: FC = ({ account, marketType, platform, product })
i18n_default_text='Your {{marketTypeTitle}} {{demoTitle}} account is ready'
values={{
demoTitle: isDemo ? localize('demo') : landingCompanyName,
- marketTypeTitle,
+ marketTypeTitle:
+ isDemo && platform === CFD_PLATFORMS.MT5
+ ? `${CFD_PLATFORMS.MT5.toUpperCase()} ${getMarketTypeDetails(localize, product)[marketType].title}`
+ : marketTypeTitle,
}}
/>
}
diff --git a/packages/wallets/src/features/cfd/modals/MT5AccountAdded/__tests__/MT5AccountAdded.spec.tsx b/packages/wallets/src/features/cfd/modals/MT5AccountAdded/__tests__/MT5AccountAdded.spec.tsx
index d82da41fb27f..d252e63753c1 100644
--- a/packages/wallets/src/features/cfd/modals/MT5AccountAdded/__tests__/MT5AccountAdded.spec.tsx
+++ b/packages/wallets/src/features/cfd/modals/MT5AccountAdded/__tests__/MT5AccountAdded.spec.tsx
@@ -74,8 +74,8 @@ describe('MT5AccountAdded', () => {
);
- expect(screen.getByText('Your Financial demo account is ready')).toBeInTheDocument();
- expect(screen.getByText("Let's practise trading with 10,000.00 USD virtual funds.")).toBeInTheDocument();
+ expect(screen.getByText('Your MT5 Financial demo account is ready')).toBeInTheDocument();
+ expect(screen.getByText('Practise trading with 10,000.00 USD virtual funds.')).toBeInTheDocument();
const okButton = screen.getAllByRole('button', { name: 'OK' })[0];
expect(okButton).toBeInTheDocument();
expect(okButton).toBeEnabled();