diff --git a/apps/scandic-web/components/Header/MainMenu/MyPagesMenu/index.tsx b/apps/scandic-web/components/Header/MainMenu/MyPagesMenu/index.tsx index 96bf11828..224c9751a 100644 --- a/apps/scandic-web/components/Header/MainMenu/MyPagesMenu/index.tsx +++ b/apps/scandic-web/components/Header/MainMenu/MyPagesMenu/index.tsx @@ -14,7 +14,7 @@ import { type FriendsMembership, getInitials } from "@/utils/user" import Avatar from "../Avatar" import MainMenuButton from "../MainMenuButton" -import MyPagesMenuContent from "../MyPagesMenuContent" +import MyPagesMenuContent, { useMyPagesNavigation } from "../MyPagesMenuContent" import styles from "./myPagesMenu.module.css" @@ -36,6 +36,9 @@ export default function MyPagesMenu({ const intl = useIntl() const myPagesMenuRef = useRef(null) + // Preload navigation content + useMyPagesNavigation() + const { toggleDropdown, isMyPagesMenuOpen } = useDropdownStore() useHandleKeyUp((event: KeyboardEvent) => { diff --git a/apps/scandic-web/components/Header/MainMenu/MyPagesMenuContent/index.tsx b/apps/scandic-web/components/Header/MainMenu/MyPagesMenuContent/index.tsx index 00e9bf402..8f5f6d696 100644 --- a/apps/scandic-web/components/Header/MainMenu/MyPagesMenuContent/index.tsx +++ b/apps/scandic-web/components/Header/MainMenu/MyPagesMenuContent/index.tsx @@ -148,7 +148,7 @@ function SecondaryLinks({ ) } -const useMyPagesNavigation = () => { +export const useMyPagesNavigation = () => { const lang = useLang() return trpc.navigation.myPages.useQuery({ lang: lang, diff --git a/apps/scandic-web/components/Header/MainMenu/index.tsx b/apps/scandic-web/components/Header/MainMenu/index.tsx index 3db207138..b713d89bc 100644 --- a/apps/scandic-web/components/Header/MainMenu/index.tsx +++ b/apps/scandic-web/components/Header/MainMenu/index.tsx @@ -4,9 +4,7 @@ import { NavigationMenuListSkeleton } from "./NavigationMenu/NavigationMenuList" import { LogoLink } from "./LogoLink" import { MobileMenuSkeleton } from "./MobileMenu" import MobileMenuWrapper from "./MobileMenuWrapper" -import MyPagesMenuWrapper, { - MyPagesMenuWrapperSkeleton, -} from "./MyPagesMenuWrapper" +import MyPagesMenuWrapper from "./MyPagesMenuWrapper" import NavigationMenu from "./NavigationMenu" import styles from "./mainMenu.module.css" @@ -20,9 +18,7 @@ export default function MainMenu() { }> - }> - - + }>