Skip to content

Commit

Permalink
chore: commented unnecessary parts
Browse files Browse the repository at this point in the history
  • Loading branch information
niloofar-deriv committed Jun 14, 2024
1 parent c040447 commit dc7a4c7
Show file tree
Hide file tree
Showing 2 changed files with 176 additions and 175 deletions.
342 changes: 176 additions & 166 deletions src/components/AppHeader/MobileMenu/MobileMenuConfig.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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();
Expand All @@ -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: <LegacyChevronRight1pxIcon iconSize='xs' />,
submenu: 'accountSettings',
// RightComponent: <LegacyChevronRight1pxIcon iconSize='xs' />,
// submenu: 'accountSettings',
},
{
as: 'button',
// as: 'button',
as: 'a',
href: `${URLConstants.derivAppProduction}/cashier/deposit`,
label: localize('Cashier'),
LeftComponent: LegacyCashierIcon,
RightComponent: <LegacyChevronRight1pxIcon iconSize='xs' />,
submenu: 'cashier',
},
{
as: 'button',
label: localize('Dark theme'),
LeftComponent: LegacyTheme1pxIcon,
RightComponent: <ToggleSwitch />,
// RightComponent: <LegacyChevronRight1pxIcon iconSize='xs' />,
// submenu: 'cashier',
},
// TODO add theme logic
// {
// as: 'button',
// label: localize('Dark theme'),
// LeftComponent: LegacyTheme1pxIcon,
// RightComponent: <ToggleSwitch />,
// },
],
[
{
Expand Down Expand Up @@ -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,
// },
],
[
{
Expand All @@ -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 };
};
Loading

0 comments on commit dc7a4c7

Please sign in to comment.