Skip to content

Commit 55509f8

Browse files
committed
feat: lazy-load CodeModal component
1 parent 2886180 commit 55509f8

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/pages/index.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { ReactNode, useState } from "react"
22
import type { GetStaticProps, InferGetStaticPropsType } from "next"
3+
import dynamic from "next/dynamic"
34
import { useRouter } from "next/router"
45
import { useTranslation } from "next-i18next"
56
import { serverSideTranslations } from "next-i18next/serverSideTranslations"
@@ -25,7 +26,6 @@ import ActionCard from "@/components/ActionCard"
2526
import ButtonLink from "@/components/Buttons/ButtonLink"
2627
import CalloutBanner from "@/components/CalloutBanner"
2728
import Codeblock from "@/components/Codeblock"
28-
import CodeModal from "@/components/CodeModal"
2929
import CommunityEvents from "@/components/CommunityEvents"
3030
import HomeHero from "@/components/Hero/HomeHero"
3131
import { Image } from "@/components/Image"
@@ -333,6 +333,11 @@ const HomePage = ({
333333

334334
const cardBoxShadow = useToken("colors", "cardBoxShadow")
335335

336+
// Lazy-load CodeModal component
337+
const CodeModal = dynamic(() => import("@/components/CodeModal"), {
338+
ssr: false,
339+
})
340+
336341
return (
337342
<Flex
338343
as={MainArticle}

0 commit comments

Comments
 (0)