diff --git a/frontend/packages/vkt/src/components/layouts/Header.tsx b/frontend/packages/vkt/src/components/layouts/Header.tsx index 104fc2b6b..cfaba288d 100644 --- a/frontend/packages/vkt/src/components/layouts/Header.tsx +++ b/frontend/packages/vkt/src/components/layouts/Header.tsx @@ -1,12 +1,10 @@ import { AppBar, Toolbar } from '@mui/material'; import { TFunction } from 'i18next'; -import { useState } from 'react'; import { Link, matchPath, useLocation } from 'react-router-dom'; import { CookieBanner, LangSelector, - MobileNavigationMenuContents, - MobileNavigationMenuToggle, + MobileNavigationMenuWithPortal, NavigationLinks, OPHClerkLogo, OPHLogoViewer, @@ -102,11 +100,7 @@ const PublicNavigationLinks = () => { ); }; -const PublicMobileNavigationMenu = ({ - closeMenu, -}: { - closeMenu: () => void; -}) => { +const PublicMobileNavigationMenu = () => { const translateCommon = useCommonTranslation(); const { pathname } = useLocation(); const { goodAndSatisfactoryLevel } = useAppSelector(featureFlagsSelector); @@ -117,13 +111,23 @@ const PublicMobileNavigationMenu = ({ translateCommon, ); + const portalContainer = document.getElementById('mobile-menu-placeholder'); + + if (!portalContainer) { + return null; + } + return ( - ); }; @@ -159,7 +163,6 @@ export const Header = (): JSX.Element => { } } }; - const [isMobileMenuOpen, setIsMobileMenuOpen] = useState(false); useInterval(heartBeat, 5000); // Every 5 seconds @@ -218,16 +221,7 @@ export const Header = (): JSX.Element => {
{isAuthenticated && } {isPublicUrl && !isPhone && } - {isPublicUrl && isPhone && ( - - )} + {isPublicUrl && isPhone && }
{isAuthenticated && } @@ -243,11 +237,6 @@ export const Header = (): JSX.Element => { )}
- {isPhone && isMobileMenuOpen && ( - setIsMobileMenuOpen(false)} - /> - )} {!isClerkUI && ( { -
+
+