diff --git a/src/components/AppHeader/MobileMenu/MenuContent.tsx b/src/components/AppHeader/MobileMenu/MenuContent.tsx index 967d3b77..a4518710 100644 --- a/src/components/AppHeader/MobileMenu/MenuContent.tsx +++ b/src/components/AppHeader/MobileMenu/MenuContent.tsx @@ -1,13 +1,11 @@ -import { useState } from 'react'; import clsx from 'clsx'; -import { MenuItem, Submenu, Text, useDevice } from '@deriv-com/ui'; +import { MenuItem, Text, useDevice } from '@deriv-com/ui'; import { PlatformSwitcher } from '../PlatformSwitcher'; -import { MobileMenuConfig, TSubmenuSection } from './MobileMenuConfig'; -import { SubmenuContent } from './SubmenuContent'; +import { MobileMenuConfig } from './MobileMenuConfig'; export const MenuContent = () => { - const [isSubmenuOpen, setIsSubmenuOpen] = useState(false); - const [renderSubmenuFor, setRenderSubmenuFor] = useState('accountSettings'); + // const [isSubmenuOpen, setIsSubmenuOpen] = useState(false); + // const [renderSubmenuFor, setRenderSubmenuFor] = useState('accountSettings'); const { isMobile } = useDevice(); const textSize = isMobile ? 'md' : 'sm'; @@ -15,11 +13,11 @@ export const MenuContent = () => { return (
- {!isSubmenuOpen && ( -
- -
- )} + {/* {!isSubmenuOpen && ( */} +
+ +
+ {/* )} */}
{data.map((item, index) => { @@ -32,54 +30,52 @@ export const MenuContent = () => { })} key={index} > - {item.map( - ({ LeftComponent, RightComponent, as, href, label, onClick, submenu, target }) => { - if (as === 'a') { - return ( - - } - target={target} - > - {label} - - ); - } + {item.map(({ LeftComponent, RightComponent, as, href, label, target }) => { + if (as === 'a') { return ( } - onClick={() => { - if (submenu) { - setRenderSubmenuFor(submenu); - setIsSubmenuOpen(true); - } else onClick?.(); - }} - rightComponent={RightComponent} + leftComponent={ + + } + target={target} > - - {label} - + {label} ); } - )} + return ( + } + // onClick={() => { + // if (submenu) { + // setRenderSubmenuFor(submenu); + // setIsSubmenuOpen(true); + // } else onClick?.(); + // }} + rightComponent={RightComponent} + > + + {label} + + + ); + })}
); })} - + {/* setIsSubmenuOpen(false)} renderContentFor={renderSubmenuFor} /> - + */}
); diff --git a/src/components/AppHeader/MobileMenu/SubmenuContent.tsx b/src/components/AppHeader/MobileMenu/SubmenuContent.tsx index a71e756e..60df5783 100644 --- a/src/components/AppHeader/MobileMenu/SubmenuContent.tsx +++ b/src/components/AppHeader/MobileMenu/SubmenuContent.tsx @@ -1,42 +1,43 @@ -import { ComponentProps } from 'react'; -import { IconTypes } from '@deriv/quill-icons'; -import { Text, useDevice } from '@deriv-com/ui'; -import { BackButton } from './BackButton'; -import { MobileMenuConfig, TSubmenuSection } from './MobileMenuConfig'; +// import { ComponentProps } from 'react'; +// import { IconTypes } from '@deriv/quill-icons'; +// import { Text, useDevice } from '@deriv-com/ui'; +// import { BackButton } from './BackButton'; +// import { MobileMenuConfig, TSubmenuSection } from './MobileMenuConfig'; -type TSubmenuContent = { - onBackClick: () => void; - renderContentFor: TSubmenuSection; -}; +// type TSubmenuContent = { +// onBackClick: () => void; +// renderContentFor: TSubmenuSection; +// }; -type TMenuItem = { - Icon: IconTypes; - fontWeight: ComponentProps['weight']; - label: string; -}; +// type TMenuItem = { +// Icon: IconTypes; +// fontWeight: ComponentProps['weight']; +// label: string; +// }; -const MenuItem = ({ Icon, fontWeight, label }: TMenuItem) => { - const { isMobile } = useDevice(); +// const MenuItem = ({ Icon, fontWeight, label }: TMenuItem) => { +// const { isMobile } = useDevice(); - return ( - <> - - - {label} - - - ); -}; +// return ( +// <> +// +// +// {label} +// +// +// ); +// }; -export const SubmenuContent = ({ onBackClick, renderContentFor }: TSubmenuContent) => { - const data = MobileMenuConfig().submenuConfig[renderContentFor]; - const { isMobile } = useDevice(); +// export const SubmenuContent = ({ onBackClick, renderContentFor }: TSubmenuContent) => { +export const SubmenuContent = () => { + // const data = MobileMenuConfig().submenuConfig[renderContentFor]; + // const { isMobile } = useDevice(); return (
- + {/* */} -
    + {/*
      {data.items.map(({ Icon, href, label, subItems }) => { const hasSubItems = subItems?.length; @@ -67,7 +68,7 @@ export const SubmenuContent = ({ onBackClick, renderContentFor }: TSubmenuConten ); })} -
    +
*/}
); };