Skip to content

Commit

Permalink
Lazy load / force client render of nav drawer and user menu
Browse files Browse the repository at this point in the history
  • Loading branch information
jonkafton committed Jan 8, 2025
1 parent 6ff102c commit 69f0b9d
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions frontends/main/src/page-components/Header/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
"use client"

import React, { FunctionComponent } from "react"
import dynamic from "next/dynamic"
import type { NavData } from "ol-components"
import {
styled,
AppBar,
NavDrawer,
Toolbar,
ActionButtonLink,
} from "ol-components"
import { styled, AppBar, Toolbar, ActionButtonLink } from "ol-components"
import {
RiSearch2Line,
RiPencilRulerLine,
Expand All @@ -25,7 +20,6 @@ import {
} from "@remixicon/react"
import { useToggle } from "ol-utilities"
import MITLogoLink from "@/components/MITLogoLink/MITLogoLink"
import UserMenu from "./UserMenu"
import { MenuButton } from "./MenuButton"
import {
DEPARTMENTS,
Expand All @@ -43,6 +37,13 @@ import {
} from "@/common/urls"
import { useUserMe } from "api/hooks/user"

const NavDrawer = dynamic(
() => import("ol-components").then((mod) => mod.NavDrawer),
{ ssr: false },
)

const UserMenu = dynamic(() => import("./UserMenu"), { ssr: false })

const Bar = styled(AppBar)(({ theme }) => ({
padding: "16px 8px",
backgroundColor: theme.custom.colors.navGray,
Expand Down

0 comments on commit 69f0b9d

Please sign in to comment.