diff --git a/libs/blocks/src/lib/navigation/index.tsx b/libs/blocks/src/lib/navigation/index.tsx index ac56e8687..9efccd8c8 100644 --- a/libs/blocks/src/lib/navigation/index.tsx +++ b/libs/blocks/src/lib/navigation/index.tsx @@ -1,4 +1,6 @@ -import { ReactNode, Suspense, lazy } from 'react'; +import { ReactNode } from 'react'; +import DesktopNavigation from './desktop'; +import MobileNav from './mobile'; import { NavLinkItems, NavigationProvider } from '@deriv-com/providers'; export interface NavigationProps { @@ -16,25 +18,21 @@ export const NavigationBlock = ({ hasLanguageSwitch = true, topNavigation, }: NavigationProps) => { - const LazyDesktopNav = lazy(() => import('./desktop')); - const LazyMobileNav = lazy(() => import('./mobile')); return ( {/* // TODO: add conditional rendering when we have useBreakpoints from quill-design */} - - - - + + ); }; diff --git a/libs/blocks/src/lib/navigation/mobile/index.tsx b/libs/blocks/src/lib/navigation/mobile/index.tsx index 474f8540c..849d5a073 100644 --- a/libs/blocks/src/lib/navigation/mobile/index.tsx +++ b/libs/blocks/src/lib/navigation/mobile/index.tsx @@ -1,10 +1,9 @@ import { FluidContainer } from '@deriv/quill-design'; import NavMobileWrapper from './mobile.wrapper'; import MobileHeader from './mobile.header'; -import MobileNavList from './mobile.nav-list'; -import MobileNavContentContainer from './mobile.nav-content.container'; import { NavigationProps } from '..'; import MobileLanguageToggler from '../language-switcher/mobile-language'; +import { Suspense, lazy } from 'react'; export const MobileNav: React.FC = ({ renderLogo, @@ -12,6 +11,10 @@ export const MobileNav: React.FC = ({ hasLanguageSwitch, topNavigation, }) => { + const LazyMobileNavList = lazy(() => import('./mobile.nav-list')); + const LazyMobileNavContent = lazy( + () => import('./mobile.nav-content.container'), + ); return ( = ({ - - + + + + {hasLanguageSwitch && }