From f0cf7f5bdc53717b0e65a59834644ee71fe17ddb Mon Sep 17 00:00:00 2001 From: shontzu-deriv Date: Fri, 28 Apr 2023 11:49:57 +0800 Subject: [PATCH] fix: roundup patch #2 based on reviews --- packages/cfd/src/Components/specbox.tsx | 2 +- packages/cfd/src/Containers/cfd-password-modal.tsx | 14 ++------------ packages/cfd/src/Helpers/config.tsx | 10 ++-------- packages/cfd/src/Helpers/constants.ts | 4 ++-- packages/shared/src/utils/cfd/cfd.ts | 13 ------------- 5 files changed, 7 insertions(+), 36 deletions(-) diff --git a/packages/cfd/src/Components/specbox.tsx b/packages/cfd/src/Components/specbox.tsx index 3d414cacc38d..249d47cd0ce2 100644 --- a/packages/cfd/src/Components/specbox.tsx +++ b/packages/cfd/src/Components/specbox.tsx @@ -3,7 +3,7 @@ import { Text } from '@deriv/components'; import { CFDAccountCopy } from './cfd-account-copy'; export type TSpecBoxProps = { - value: string | undefined; + value?: string; is_bold?: boolean; }; diff --git a/packages/cfd/src/Containers/cfd-password-modal.tsx b/packages/cfd/src/Containers/cfd-password-modal.tsx index 769369414a3c..d257622014a7 100644 --- a/packages/cfd/src/Containers/cfd-password-modal.tsx +++ b/packages/cfd/src/Containers/cfd-password-modal.tsx @@ -539,12 +539,7 @@ const CFDPasswordForm = ({ i18n_default_text='Enter your {{platform}} password to add a {{platform_name}} {{account}} {{jurisdiction_shortcode}} account.' values={{ platform: getCFDPlatformLabel(platform), - platform_name: - platform === CFD_PLATFORMS.MT5 - ? 'MT5' - : CFD_PLATFORMS.DXTRADE - ? 'Deriv X' - : 'Deriv Ez', + platform_name: getCFDPlatformLabel(platform), account: !show_eu_related_content ? account_title : '', jurisdiction_shortcode: showJuristiction(), }} @@ -555,12 +550,7 @@ const CFDPasswordForm = ({ i18n_default_text='Enter your {{platform}} password to add a {{platform_name}} {{account}} account.' values={{ platform: getCFDPlatformLabel(platform), - platform_name: - platform === CFD_PLATFORMS.MT5 - ? 'MT5' - : CFD_PLATFORMS.DXTRADE - ? 'Deriv X' - : 'Deriv Ez', + platform_name: getCFDPlatformLabel(platform), account: account_title, }} /> diff --git a/packages/cfd/src/Helpers/config.tsx b/packages/cfd/src/Helpers/config.tsx index 4fcb737c1406..4febdbd5b8c9 100644 --- a/packages/cfd/src/Helpers/config.tsx +++ b/packages/cfd/src/Helpers/config.tsx @@ -1,13 +1,7 @@ import React from 'react'; import { QRCode } from 'react-qrcode'; import { TCFDsPlatformType } from 'Components/props.types'; -import { - getDXTradeWebTerminalLink, - platformsText, - DERIVEZ_URL, - platforms_icons, - mobileDownloadLink, -} from './constants'; +import { getDXTradeWebTerminalLink, platformsText, DERIVEZ_URL, platformsIcons, mobileDownloadLink } from './constants'; import { Text, Icon } from '@deriv/components'; import { Localize } from '@deriv/translations'; import { isMobile, OSDetect, isDesktopOs } from '@deriv/shared'; @@ -66,7 +60,7 @@ export const PlatformsDesktopDownload = ({ platform, dxtrade_tokens, is_demo }: >
diff --git a/packages/cfd/src/Helpers/constants.ts b/packages/cfd/src/Helpers/constants.ts index fd143ed032a0..7a23eb6d7bcb 100644 --- a/packages/cfd/src/Helpers/constants.ts +++ b/packages/cfd/src/Helpers/constants.ts @@ -13,7 +13,7 @@ const platformsText = (platform: TCFDsPlatformType) => { } }; -const platforms_icons = (platform: TCFDsPlatformType) => { +const platformsIcons = (platform: TCFDsPlatformType) => { switch (platform) { case 'derivez': return 'DerivEz'; @@ -133,7 +133,7 @@ export { DERIVEZ_URL, getBrokerName, platformsText, - platforms_icons, + platformsIcons, getTitle, mobileDownloadLink, getPlatformDXTradeDownloadLink, diff --git a/packages/shared/src/utils/cfd/cfd.ts b/packages/shared/src/utils/cfd/cfd.ts index 7c4faffc7a0d..1853fec45380 100644 --- a/packages/shared/src/utils/cfd/cfd.ts +++ b/packages/shared/src/utils/cfd/cfd.ts @@ -205,19 +205,6 @@ export const getCFDPlatformLabel = (platform: TPlatform) => { } }; -export const getCFDPlatformNames = (platform: TPlatform) => { - switch (platform) { - case CFD_PLATFORMS.MT5: - return 'MT5'; - case CFD_PLATFORMS.DXTRADE: - return 'Deriv X'; - case CFD_PLATFORMS.DERIVEZ: - return 'Deriv Ez'; - default: - return ''; - } -}; - type TIsLandingCompanyEnabled = { landing_companies: LandingCompany; platform: TPlatform;