Skip to content

Commit

Permalink
chore: removed commented code
Browse files Browse the repository at this point in the history
  • Loading branch information
niloofar-deriv committed Jun 14, 2024
1 parent 8b9fb6d commit 28e86ea
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 259 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"@babel/preset-env": "^7.24.5",
"@deriv-com/api-hooks": "^1.1.2",
"@deriv-com/translations": "^1.2.4",
"@deriv-com/ui": "^1.28.2",
"@deriv-com/ui": "^1.28.3",
"@deriv-com/utils": "^0.0.25",
"@deriv/deriv-api": "^1.0.15",
"@deriv/quill-design": "^1.2.24",
Expand Down
21 changes: 3 additions & 18 deletions src/components/AppHeader/MobileMenu/MenuContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,17 @@ import { PlatformSwitcher } from '../PlatformSwitcher';
import { MobileMenuConfig } from './MobileMenuConfig';

export const MenuContent = () => {
// const [isSubmenuOpen, setIsSubmenuOpen] = useState(false);
// const [renderSubmenuFor, setRenderSubmenuFor] = useState<TSubmenuSection>('accountSettings');
const { isMobile } = useDevice();
const textSize = isMobile ? 'md' : 'sm';

const data = MobileMenuConfig().menuConfig;

return (
<div className='flex flex-col h-full'>
{/* {!isSubmenuOpen && ( */}
<div className='flex items-center justify-center h-28 border-b border-[#f2f3f4]'>
<PlatformSwitcher />
</div>
{/* )} */}

<div className='relative h-full pt-4'>
{data.map((item, index) => {
{MobileMenuConfig().map((item, index) => {
const removeBorderBottom = item.find(({ removeBorderBottom }) => removeBorderBottom);

return (
Expand All @@ -30,7 +24,7 @@ export const MenuContent = () => {
})}
key={index}
>
{item.map(({ LeftComponent, RightComponent, as, href, label, target }) => {
{item.map(({ LeftComponent, RightComponent, as, href, label, onClick, target }) => {
if (as === 'a') {
return (
<MenuItem
Expand All @@ -55,12 +49,7 @@ export const MenuContent = () => {
disableHover
key={label}
leftComponent={<LeftComponent className='mr-[1.6rem]' iconSize='xs' />}
// onClick={() => {
// if (submenu) {
// setRenderSubmenuFor(submenu);
// setIsSubmenuOpen(true);
// } else onClick?.();
// }}
onClick={onClick}
rightComponent={RightComponent}
>
<Text className='mr-auto' size={textSize}>
Expand All @@ -72,10 +61,6 @@ export const MenuContent = () => {
</div>
);
})}

{/* <Submenu className='overflow-y-auto z-10' isOpen={isSubmenuOpen}>
<SubmenuContent onBackClick={() => setIsSubmenuOpen(false)} renderContentFor={renderSubmenuFor} />
</Submenu> */}
</div>
</div>
);
Expand Down
163 changes: 1 addition & 162 deletions src/components/AppHeader/MobileMenu/MobileMenuConfig.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,17 @@ import {
BrandDerivLogoCoralIcon,
IconTypes,
LegacyAccountLimitsIcon,
// LegacyAssessmentIcon,
LegacyCashierIcon,
LegacyChartsIcon,
// LegacyChevronRight1pxIcon,
// LegacyDepositIcon,
LegacyHelpCentreIcon,
LegacyHomeOldIcon,
// LegacyLiveChatOutlineIcon,
LegacyLogout1pxIcon,
LegacyProfileSmIcon,
LegacyResponsibleTradingIcon,
// LegacySecurityIcon,
// LegacyTheme1pxIcon,
// LegacyTransferIcon,
// LegacyVerificationIcon,
LegacyWhatsappIcon,
// 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 { URLConstants } from '@deriv-com/utils';

export type TSubmenuSection = 'accountSettings' | 'cashier';
Expand All @@ -41,26 +31,6 @@ 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 TSubmenuConfig = {
// accountSettings: TSubmenu;
// cashier: TSubmenu;
// };

export const MobileMenuConfig = () => {
const { localize } = useTranslations();
const { logout } = useAuthData();
Expand All @@ -86,22 +56,16 @@ export const MobileMenuConfig = () => {
LeftComponent: LegacyChartsIcon,
},
{
// as: 'button',
as: 'a',
href: `${URLConstants.derivAppProduction}/account/personal-details`,
label: localize('Account Settings'),
LeftComponent: LegacyProfileSmIcon,
// RightComponent: <LegacyChevronRight1pxIcon iconSize='xs' />,
// submenu: 'accountSettings',
},
{
// as: 'button',
as: 'a',
href: `${URLConstants.derivAppProduction}/cashier/deposit`,
label: localize('Cashier'),
LeftComponent: LegacyCashierIcon,
// RightComponent: <LegacyChevronRight1pxIcon iconSize='xs' />,
// submenu: 'cashier',
},
// TODO add theme logic
// {
Expand Down Expand Up @@ -155,130 +119,5 @@ export const MobileMenuConfig = () => {
],
];

// 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 };
return menuConfig;
};
74 changes: 0 additions & 74 deletions src/components/AppHeader/MobileMenu/SubmenuContent.tsx

This file was deleted.

1 change: 1 addition & 0 deletions src/components/AppHeader/MobileMenu/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export const MobileMenu = () => {
onClose={hideModal}
onLanguageSwitch={switchLanguage}
selectedLanguage={currentLang}
wrapperClassName='px-[0.8rem]'
/>
</>
) : (
Expand Down
3 changes: 3 additions & 0 deletions src/components/AppHeader/PlatformSwitcher/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,13 @@ export const PlatformSwitcher = () => {
className: 'hover:bg-transparent xl:hover:bg-[#e6e9e9] px-[1.6rem]',
icon: platformsConfig[0].buttonIcon,
}}
itemsWrapperClassName='top-48 h-full xl:top-[4.7rem] xl:h-auto'
overlayClassName='top-48 xl:top-[4.7rem]'
>
{platformsConfig.map(({ active, description, href, icon }) => (
<PlatformSwitcherItem
active={active}
className='py-[1.4rem] px-[1.6rem] my-[1.4rem] mx-[1.6rem] h-auto xl:py-[2.4rem] xl:px-[1.6rem] xl:m-[1.6rem] xl:mt-[2.4rem] xl:h-[14.3rem]'
description={localize('{{description}}', { description })}
href={href}
icon={icon}
Expand Down

0 comments on commit 28e86ea

Please sign in to comment.