From dc7a4c7655f54004947a3ee3b342b5ca2b6bb848 Mon Sep 17 00:00:00 2001 From: Niloofar Date: Fri, 14 Jun 2024 14:22:44 +0800 Subject: [PATCH] chore: commented unnecessary parts --- .../AppHeader/MobileMenu/MobileMenuConfig.tsx | 342 +++++++++--------- src/components/AppHeader/MobileMenu/index.tsx | 9 - 2 files changed, 176 insertions(+), 175 deletions(-) diff --git a/src/components/AppHeader/MobileMenu/MobileMenuConfig.tsx b/src/components/AppHeader/MobileMenu/MobileMenuConfig.tsx index 9461c319..3c155e26 100644 --- a/src/components/AppHeader/MobileMenu/MobileMenuConfig.tsx +++ b/src/components/AppHeader/MobileMenu/MobileMenuConfig.tsx @@ -4,27 +4,27 @@ import { BrandDerivLogoCoralIcon, IconTypes, LegacyAccountLimitsIcon, - LegacyAssessmentIcon, + // LegacyAssessmentIcon, LegacyCashierIcon, LegacyChartsIcon, - LegacyChevronRight1pxIcon, - LegacyDepositIcon, + // LegacyChevronRight1pxIcon, + // LegacyDepositIcon, LegacyHelpCentreIcon, LegacyHomeOldIcon, - LegacyLiveChatOutlineIcon, + // LegacyLiveChatOutlineIcon, LegacyLogout1pxIcon, LegacyProfileSmIcon, LegacyResponsibleTradingIcon, - LegacySecurityIcon, - LegacyTheme1pxIcon, - LegacyTransferIcon, - LegacyVerificationIcon, + // LegacySecurityIcon, + // LegacyTheme1pxIcon, + // LegacyTransferIcon, + // LegacyVerificationIcon, LegacyWhatsappIcon, - LegacyWithdrawalIcon, + // LegacyWithdrawalIcon, } from '@deriv/quill-icons'; import { useAuthData } from '@deriv-com/api-hooks'; import { useTranslations } from '@deriv-com/translations'; -import { ToggleSwitch } from '@deriv-com/ui'; +// import { ToggleSwitch } from '@deriv-com/ui'; import { URLConstants } from '@deriv-com/utils'; export type TSubmenuSection = 'accountSettings' | 'cashier'; @@ -41,25 +41,25 @@ type TMenuConfig = { target?: ComponentProps<'a'>['target']; }[]; -type TSubmenu = { - items: { - Icon: IconTypes; - href?: string; - label: string; - subItems?: { - href?: string; - onClick?: ComponentProps<'button'>['onClick']; - text: string; - }[]; - }[]; - section: string; - title: string; -}; +// type TSubmenu = { +// items: { +// Icon: IconTypes; +// href?: string; +// label: string; +// subItems?: { +// href?: string; +// onClick?: ComponentProps<'button'>['onClick']; +// text: string; +// }[]; +// }[]; +// section: string; +// title: string; +// }; -type TSubmenuConfig = { - accountSettings: TSubmenu; - cashier: TSubmenu; -}; +// type TSubmenuConfig = { +// accountSettings: TSubmenu; +// cashier: TSubmenu; +// }; export const MobileMenuConfig = () => { const { localize } = useTranslations(); @@ -86,25 +86,30 @@ export const MobileMenuConfig = () => { LeftComponent: LegacyChartsIcon, }, { - as: 'button', + // as: 'button', + as: 'a', + href: `${URLConstants.derivAppProduction}/account/personal-details`, label: localize('Account Settings'), LeftComponent: LegacyProfileSmIcon, - RightComponent: , - submenu: 'accountSettings', + // RightComponent: , + // submenu: 'accountSettings', }, { - as: 'button', + // as: 'button', + as: 'a', + href: `${URLConstants.derivAppProduction}/cashier/deposit`, label: localize('Cashier'), LeftComponent: LegacyCashierIcon, - RightComponent: , - submenu: 'cashier', - }, - { - as: 'button', - label: localize('Dark theme'), - LeftComponent: LegacyTheme1pxIcon, - RightComponent: , + // RightComponent: , + // submenu: 'cashier', }, + // TODO add theme logic + // { + // as: 'button', + // label: localize('Dark theme'), + // LeftComponent: LegacyTheme1pxIcon, + // RightComponent: , + // }, ], [ { @@ -132,11 +137,12 @@ export const MobileMenuConfig = () => { LeftComponent: LegacyWhatsappIcon, target: '_blank', }, - { - as: 'button', - label: localize('Live chat'), - LeftComponent: LegacyLiveChatOutlineIcon, - }, + // TODO add livechat logic + // { + // as: 'button', + // label: localize('Live chat'), + // LeftComponent: LegacyLiveChatOutlineIcon, + // }, ], [ { @@ -149,126 +155,130 @@ export const MobileMenuConfig = () => { ], ]; - const submenuConfig: TSubmenuConfig = { - accountSettings: { - items: [ - { - Icon: LegacyProfileSmIcon, - label: localize('Profile'), - subItems: [ - { - href: `${URLConstants.derivAppProduction}/account/personal-details`, - text: localize('Personal details'), - }, - { - text: localize('Languages'), - }, - ], - }, - { - Icon: LegacyAssessmentIcon, - label: localize('Assessments'), - subItems: [ - { - href: `${URLConstants.derivAppProduction}/account/trading-assessment`, - text: localize('Trading assessment'), - }, - { - href: `${URLConstants.derivAppProduction}/account/financial-assessment`, - text: localize('Financial assessment'), - }, - ], - }, - { - Icon: LegacyVerificationIcon, - label: localize('Verification'), - subItems: [ - { - href: `${URLConstants.derivAppProduction}/account/proof-of-identity`, - text: localize('Proof of identity'), - }, - { - href: `${URLConstants.derivAppProduction}/account/proof-of-address`, - text: localize('Proof of address'), - }, - { - href: `${URLConstants.derivAppProduction}/account/proof-of-ownership`, - text: localize('Proof of ownership'), - }, - { - href: `${URLConstants.derivAppProduction}/account/proof-of-income`, - text: localize('Proof of income'), - }, - ], - }, - { - Icon: LegacySecurityIcon, - label: localize('Security and safety'), - subItems: [ - { - href: `${URLConstants.derivAppProduction}/account/passwords`, - text: localize('Email and passwords'), - }, - { - href: `${URLConstants.derivAppProduction}/account/passkeys`, - text: localize('Passkeys'), - }, - { - href: `${URLConstants.derivAppProduction}/account/self-exclusion`, - text: localize('Self exclusion'), - }, - { - href: `${URLConstants.derivAppProduction}/account/account-limits`, - text: localize('Account limits'), - }, - { - href: `${URLConstants.derivAppProduction}/account/login-history`, - text: localize('Login history'), - }, - { - href: `${URLConstants.derivAppProduction}/account/api-token`, - text: localize('API token'), - }, - { - href: `${URLConstants.derivAppProduction}/account/connected-apps`, - text: localize('Connected apps'), - }, - { - href: `${URLConstants.derivAppProduction}/account/two-factor-authentication`, - text: localize('Two-factor authentication'), - }, - { - href: `${URLConstants.derivAppProduction}/account/closing-account`, - text: localize('Close your account'), - }, - ], - }, - ], - section: 'account', - title: localize('Account Settings'), - }, - cashier: { - items: [ - { - href: `${URLConstants.derivAppProduction}/cashier/deposit`, - Icon: LegacyDepositIcon, - label: localize('Deposit'), - }, - { - href: `${URLConstants.derivAppProduction}/cashier/withdrawal`, - Icon: LegacyWithdrawalIcon, - label: localize('Withdrawal'), - }, - { - href: `${URLConstants.derivAppProduction}/cashier/account-transfer`, - Icon: LegacyTransferIcon, - label: localize('Transfer'), - }, - ], - section: 'cashier', - title: localize('Cashier'), - }, - }; + // const submenuConfig: TSubmenuConfig = { + // TODO add disable/enable conditions to the accountsettings menu + // accountSettings: { + // items: [ + // { + // Icon: LegacyProfileSmIcon, + // label: localize('Profile'), + // subItems: [ + // { + // href: `${URLConstants.derivAppProduction}/account/personal-details`, + // text: localize('Personal details'), + // }, + // { + // TODO add OpenLanguageSetting onClick + // text: localize('Languages'), + // }, + // ], + // }, + // { + // Icon: LegacyAssessmentIcon, + // label: localize('Assessments'), + // subItems: [ + // { + // href: `${URLConstants.derivAppProduction}/account/trading-assessment`, + // text: localize('Trading assessment'), + // }, + // { + // href: `${URLConstants.derivAppProduction}/account/financial-assessment`, + // text: localize('Financial assessment'), + // }, + // ], + // }, + // { + // Icon: LegacyVerificationIcon, + // label: localize('Verification'), + // subItems: [ + // { + // href: `${URLConstants.derivAppProduction}/account/proof-of-identity`, + // text: localize('Proof of identity'), + // }, + // { + // href: `${URLConstants.derivAppProduction}/account/proof-of-address`, + // text: localize('Proof of address'), + // }, + // { + // href: `${URLConstants.derivAppProduction}/account/proof-of-ownership`, + // text: localize('Proof of ownership'), + // }, + // { + // href: `${URLConstants.derivAppProduction}/account/proof-of-income`, + // text: localize('Proof of income'), + // }, + // ], + // }, + // { + // Icon: LegacySecurityIcon, + // label: localize('Security and safety'), + // subItems: [ + // { + // href: `${URLConstants.derivAppProduction}/account/passwords`, + // text: localize('Email and passwords'), + // }, + // { + // TODO add new badge for passkey + // href: `${URLConstants.derivAppProduction}/account/passkeys`, + // text: localize('Passkeys'), + // }, + // { + // href: `${URLConstants.derivAppProduction}/account/self-exclusion`, + // text: localize('Self exclusion'), + // }, + // { + // href: `${URLConstants.derivAppProduction}/account/account-limits`, + // text: localize('Account limits'), + // }, + // { + // href: `${URLConstants.derivAppProduction}/account/login-history`, + // text: localize('Login history'), + // }, + // { + // href: `${URLConstants.derivAppProduction}/account/api-token`, + // text: localize('API token'), + // }, + // { + // href: `${URLConstants.derivAppProduction}/account/connected-apps`, + // text: localize('Connected apps'), + // }, + // { + // href: `${URLConstants.derivAppProduction}/account/two-factor-authentication`, + // text: localize('Two-factor authentication'), + // }, + // { + // href: `${URLConstants.derivAppProduction}/account/closing-account`, + // text: localize('Close your account'), + // }, + // ], + // }, + // ], + // section: 'account', + // title: localize('Account Settings'), + // }, + // cashier: { + // items: [ + // { + // href: `${URLConstants.derivAppProduction}/cashier/deposit`, + // Icon: LegacyDepositIcon, + // label: localize('Deposit'), + // }, + // { + // href: `${URLConstants.derivAppProduction}/cashier/withdrawal`, + // Icon: LegacyWithdrawalIcon, + // label: localize('Withdrawal'), + // }, + // { + // href: `${URLConstants.derivAppProduction}/cashier/account-transfer`, + // Icon: LegacyTransferIcon, + // label: localize('Transfer'), + // }, + // ], + // section: 'cashier', + // title: localize('Cashier'), + // }, + // }; - return { menuConfig, submenuConfig }; + // return { menuConfig, submenuConfig }; + return { menuConfig }; }; diff --git a/src/components/AppHeader/MobileMenu/index.tsx b/src/components/AppHeader/MobileMenu/index.tsx index 97e7c868..90133b06 100644 --- a/src/components/AppHeader/MobileMenu/index.tsx +++ b/src/components/AppHeader/MobileMenu/index.tsx @@ -10,15 +10,6 @@ import { MenuContent } from './MenuContent'; import { MenuHeader } from './MenuHeader'; import { ToggleButton } from './ToggleButton'; -// TODO the design inside LanguageSwitcher does not match the production => change from ui side -// TODO fix platformswitcher issue in the tablet -// TODO Dark theme logic -// TODO livechat logic - -// TODO adding language to the sidemenu>accountsettings -// TODO add disable condition to the accountsettings menu -// TODO new badge for passkey - export const MobileMenu = () => { const [isDrawerOpen, setIsDrawerOpen] = useState(false); const { currentLang = 'EN', localize, switchLanguage } = useTranslations();