Skip to content

Commit 28e86ea

Browse files
chore: removed commented code
1 parent 8b9fb6d commit 28e86ea

File tree

7 files changed

+13
-259
lines changed

7 files changed

+13
-259
lines changed

package-lock.json

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"@babel/preset-env": "^7.24.5",
1818
"@deriv-com/api-hooks": "^1.1.2",
1919
"@deriv-com/translations": "^1.2.4",
20-
"@deriv-com/ui": "^1.28.2",
20+
"@deriv-com/ui": "^1.28.3",
2121
"@deriv-com/utils": "^0.0.25",
2222
"@deriv/deriv-api": "^1.0.15",
2323
"@deriv/quill-design": "^1.2.24",

src/components/AppHeader/MobileMenu/MenuContent.tsx

+3-18
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,17 @@ import { PlatformSwitcher } from '../PlatformSwitcher';
44
import { MobileMenuConfig } from './MobileMenuConfig';
55

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

12-
const data = MobileMenuConfig().menuConfig;
13-
1410
return (
1511
<div className='flex flex-col h-full'>
16-
{/* {!isSubmenuOpen && ( */}
1712
<div className='flex items-center justify-center h-28 border-b border-[#f2f3f4]'>
1813
<PlatformSwitcher />
1914
</div>
20-
{/* )} */}
2115

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

2620
return (
@@ -30,7 +24,7 @@ export const MenuContent = () => {
3024
})}
3125
key={index}
3226
>
33-
{item.map(({ LeftComponent, RightComponent, as, href, label, target }) => {
27+
{item.map(({ LeftComponent, RightComponent, as, href, label, onClick, target }) => {
3428
if (as === 'a') {
3529
return (
3630
<MenuItem
@@ -55,12 +49,7 @@ export const MenuContent = () => {
5549
disableHover
5650
key={label}
5751
leftComponent={<LeftComponent className='mr-[1.6rem]' iconSize='xs' />}
58-
// onClick={() => {
59-
// if (submenu) {
60-
// setRenderSubmenuFor(submenu);
61-
// setIsSubmenuOpen(true);
62-
// } else onClick?.();
63-
// }}
52+
onClick={onClick}
6453
rightComponent={RightComponent}
6554
>
6655
<Text className='mr-auto' size={textSize}>
@@ -72,10 +61,6 @@ export const MenuContent = () => {
7261
</div>
7362
);
7463
})}
75-
76-
{/* <Submenu className='overflow-y-auto z-10' isOpen={isSubmenuOpen}>
77-
<SubmenuContent onBackClick={() => setIsSubmenuOpen(false)} renderContentFor={renderSubmenuFor} />
78-
</Submenu> */}
7964
</div>
8065
</div>
8166
);

src/components/AppHeader/MobileMenu/MobileMenuConfig.tsx

+1-162
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,17 @@ import {
44
BrandDerivLogoCoralIcon,
55
IconTypes,
66
LegacyAccountLimitsIcon,
7-
// LegacyAssessmentIcon,
87
LegacyCashierIcon,
98
LegacyChartsIcon,
10-
// LegacyChevronRight1pxIcon,
11-
// LegacyDepositIcon,
129
LegacyHelpCentreIcon,
1310
LegacyHomeOldIcon,
14-
// LegacyLiveChatOutlineIcon,
1511
LegacyLogout1pxIcon,
1612
LegacyProfileSmIcon,
1713
LegacyResponsibleTradingIcon,
18-
// LegacySecurityIcon,
19-
// LegacyTheme1pxIcon,
20-
// LegacyTransferIcon,
21-
// LegacyVerificationIcon,
2214
LegacyWhatsappIcon,
23-
// LegacyWithdrawalIcon,
2415
} from '@deriv/quill-icons';
2516
import { useAuthData } from '@deriv-com/api-hooks';
2617
import { useTranslations } from '@deriv-com/translations';
27-
// import { ToggleSwitch } from '@deriv-com/ui';
2818
import { URLConstants } from '@deriv-com/utils';
2919

3020
export type TSubmenuSection = 'accountSettings' | 'cashier';
@@ -41,26 +31,6 @@ type TMenuConfig = {
4131
target?: ComponentProps<'a'>['target'];
4232
}[];
4333

44-
// type TSubmenu = {
45-
// items: {
46-
// Icon: IconTypes;
47-
// href?: string;
48-
// label: string;
49-
// subItems?: {
50-
// href?: string;
51-
// onClick?: ComponentProps<'button'>['onClick'];
52-
// text: string;
53-
// }[];
54-
// }[];
55-
// section: string;
56-
// title: string;
57-
// };
58-
59-
// type TSubmenuConfig = {
60-
// accountSettings: TSubmenu;
61-
// cashier: TSubmenu;
62-
// };
63-
6434
export const MobileMenuConfig = () => {
6535
const { localize } = useTranslations();
6636
const { logout } = useAuthData();
@@ -86,22 +56,16 @@ export const MobileMenuConfig = () => {
8656
LeftComponent: LegacyChartsIcon,
8757
},
8858
{
89-
// as: 'button',
9059
as: 'a',
9160
href: `${URLConstants.derivAppProduction}/account/personal-details`,
9261
label: localize('Account Settings'),
9362
LeftComponent: LegacyProfileSmIcon,
94-
// RightComponent: <LegacyChevronRight1pxIcon iconSize='xs' />,
95-
// submenu: 'accountSettings',
9663
},
9764
{
98-
// as: 'button',
9965
as: 'a',
10066
href: `${URLConstants.derivAppProduction}/cashier/deposit`,
10167
label: localize('Cashier'),
10268
LeftComponent: LegacyCashierIcon,
103-
// RightComponent: <LegacyChevronRight1pxIcon iconSize='xs' />,
104-
// submenu: 'cashier',
10569
},
10670
// TODO add theme logic
10771
// {
@@ -155,130 +119,5 @@ export const MobileMenuConfig = () => {
155119
],
156120
];
157121

158-
// const submenuConfig: TSubmenuConfig = {
159-
// TODO add disable/enable conditions to the accountsettings menu
160-
// accountSettings: {
161-
// items: [
162-
// {
163-
// Icon: LegacyProfileSmIcon,
164-
// label: localize('Profile'),
165-
// subItems: [
166-
// {
167-
// href: `${URLConstants.derivAppProduction}/account/personal-details`,
168-
// text: localize('Personal details'),
169-
// },
170-
// {
171-
// TODO add OpenLanguageSetting onClick
172-
// text: localize('Languages'),
173-
// },
174-
// ],
175-
// },
176-
// {
177-
// Icon: LegacyAssessmentIcon,
178-
// label: localize('Assessments'),
179-
// subItems: [
180-
// {
181-
// href: `${URLConstants.derivAppProduction}/account/trading-assessment`,
182-
// text: localize('Trading assessment'),
183-
// },
184-
// {
185-
// href: `${URLConstants.derivAppProduction}/account/financial-assessment`,
186-
// text: localize('Financial assessment'),
187-
// },
188-
// ],
189-
// },
190-
// {
191-
// Icon: LegacyVerificationIcon,
192-
// label: localize('Verification'),
193-
// subItems: [
194-
// {
195-
// href: `${URLConstants.derivAppProduction}/account/proof-of-identity`,
196-
// text: localize('Proof of identity'),
197-
// },
198-
// {
199-
// href: `${URLConstants.derivAppProduction}/account/proof-of-address`,
200-
// text: localize('Proof of address'),
201-
// },
202-
// {
203-
// href: `${URLConstants.derivAppProduction}/account/proof-of-ownership`,
204-
// text: localize('Proof of ownership'),
205-
// },
206-
// {
207-
// href: `${URLConstants.derivAppProduction}/account/proof-of-income`,
208-
// text: localize('Proof of income'),
209-
// },
210-
// ],
211-
// },
212-
// {
213-
// Icon: LegacySecurityIcon,
214-
// label: localize('Security and safety'),
215-
// subItems: [
216-
// {
217-
// href: `${URLConstants.derivAppProduction}/account/passwords`,
218-
// text: localize('Email and passwords'),
219-
// },
220-
// {
221-
// TODO add new badge for passkey
222-
// href: `${URLConstants.derivAppProduction}/account/passkeys`,
223-
// text: localize('Passkeys'),
224-
// },
225-
// {
226-
// href: `${URLConstants.derivAppProduction}/account/self-exclusion`,
227-
// text: localize('Self exclusion'),
228-
// },
229-
// {
230-
// href: `${URLConstants.derivAppProduction}/account/account-limits`,
231-
// text: localize('Account limits'),
232-
// },
233-
// {
234-
// href: `${URLConstants.derivAppProduction}/account/login-history`,
235-
// text: localize('Login history'),
236-
// },
237-
// {
238-
// href: `${URLConstants.derivAppProduction}/account/api-token`,
239-
// text: localize('API token'),
240-
// },
241-
// {
242-
// href: `${URLConstants.derivAppProduction}/account/connected-apps`,
243-
// text: localize('Connected apps'),
244-
// },
245-
// {
246-
// href: `${URLConstants.derivAppProduction}/account/two-factor-authentication`,
247-
// text: localize('Two-factor authentication'),
248-
// },
249-
// {
250-
// href: `${URLConstants.derivAppProduction}/account/closing-account`,
251-
// text: localize('Close your account'),
252-
// },
253-
// ],
254-
// },
255-
// ],
256-
// section: 'account',
257-
// title: localize('Account Settings'),
258-
// },
259-
// cashier: {
260-
// items: [
261-
// {
262-
// href: `${URLConstants.derivAppProduction}/cashier/deposit`,
263-
// Icon: LegacyDepositIcon,
264-
// label: localize('Deposit'),
265-
// },
266-
// {
267-
// href: `${URLConstants.derivAppProduction}/cashier/withdrawal`,
268-
// Icon: LegacyWithdrawalIcon,
269-
// label: localize('Withdrawal'),
270-
// },
271-
// {
272-
// href: `${URLConstants.derivAppProduction}/cashier/account-transfer`,
273-
// Icon: LegacyTransferIcon,
274-
// label: localize('Transfer'),
275-
// },
276-
// ],
277-
// section: 'cashier',
278-
// title: localize('Cashier'),
279-
// },
280-
// };
281-
282-
// return { menuConfig, submenuConfig };
283-
return { menuConfig };
122+
return menuConfig;
284123
};

src/components/AppHeader/MobileMenu/SubmenuContent.tsx

-74
This file was deleted.

src/components/AppHeader/MobileMenu/index.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ export const MobileMenu = () => {
4646
onClose={hideModal}
4747
onLanguageSwitch={switchLanguage}
4848
selectedLanguage={currentLang}
49+
wrapperClassName='px-[0.8rem]'
4950
/>
5051
</>
5152
) : (

src/components/AppHeader/PlatformSwitcher/index.tsx

+3
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,13 @@ export const PlatformSwitcher = () => {
1212
className: 'hover:bg-transparent xl:hover:bg-[#e6e9e9] px-[1.6rem]',
1313
icon: platformsConfig[0].buttonIcon,
1414
}}
15+
itemsWrapperClassName='top-48 h-full xl:top-[4.7rem] xl:h-auto'
16+
overlayClassName='top-48 xl:top-[4.7rem]'
1517
>
1618
{platformsConfig.map(({ active, description, href, icon }) => (
1719
<PlatformSwitcherItem
1820
active={active}
21+
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]'
1922
description={localize('{{description}}', { description })}
2023
href={href}
2124
icon={icon}

0 commit comments

Comments
 (0)