From c883ab46cc0f8a7628c440ad911d4815b5968402 Mon Sep 17 00:00:00 2001 From: brian-ngyn Date: Mon, 4 Mar 2024 19:28:27 -0700 Subject: [PATCH] make the CarGraphicComponent SSR instead of the HeroComponent --- client/src/components/containers/HeroContainer.tsx | 13 ++++++++++++- client/src/pages/[[...slug]].tsx | 10 +--------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/client/src/components/containers/HeroContainer.tsx b/client/src/components/containers/HeroContainer.tsx index 1031c1cd..66cfb83f 100644 --- a/client/src/components/containers/HeroContainer.tsx +++ b/client/src/components/containers/HeroContainer.tsx @@ -1,8 +1,19 @@ +import dynamic from "next/dynamic"; + import BatteryThrottleComponent from "@/components/molecules/HeroMolecules/BatteryThrottleComponent"; -import CarGraphicComponent from "@/components/molecules/HeroMolecules/CarGraphicComponent"; import FaultsComponent from "@/components/molecules/HeroMolecules/FaultsComponent"; import GearParkBrakeComponent from "@/components/molecules/HeroMolecules/GearParkBrakeComponent"; +const CarGraphicComponent = dynamic( + () => + import("@/components/molecules/HeroMolecules/CarGraphicComponent").then( + (mod) => mod.default, + ), + { + ssr: false, + }, +); + function HeroContainer(props: any) { return ( <> diff --git a/client/src/pages/[[...slug]].tsx b/client/src/pages/[[...slug]].tsx index 7b208aae..314d7c64 100644 --- a/client/src/pages/[[...slug]].tsx +++ b/client/src/pages/[[...slug]].tsx @@ -1,7 +1,7 @@ -import dynamic from "next/dynamic"; import { Inter } from "next/font/google"; import BottomInformationContainer from "@/components/containers/BottomInformationContainer"; +import HeroContainer from "@/components/containers/HeroContainer"; import LogoStatusContainer from "@/components/containers/LogoStatusContainer"; import MapContainer from "@/components/containers/MapContainer"; import TabsContainer from "@/components/containers/TabsContainer"; @@ -9,14 +9,6 @@ import { useAppState } from "@/contexts/AppStateContext"; const inter = Inter({ subsets: ["latin"] }); -const HeroContainer = dynamic( - () => - import("@/components/containers/HeroContainer").then((mod) => mod.default), - { - ssr: false, - }, -); - export default function Home() { const { currentAppState } = useAppState(); // 38, 55, 7