Skip to content

Commit 088cf49

Browse files
committed
fix: 10-years 500; ssr false globe
1 parent edb91bd commit 088cf49

File tree

1 file changed

+23
-11
lines changed

1 file changed

+23
-11
lines changed

app/[locale]/10years/page.tsx

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
import { Suspense } from "react"
12
import { pick } from "lodash"
3+
import dynamic from "next/dynamic"
24
import {
35
getMessages,
46
getTranslations,
@@ -13,6 +15,7 @@ import { Image } from "@/components/Image"
1315
import MainArticle from "@/components/MainArticle"
1416
import { ButtonLink } from "@/components/ui/buttons/Button"
1517
import { LinkBox, LinkOverlay } from "@/components/ui/link-box"
18+
import { Skeleton } from "@/components/ui/skeleton"
1619
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"
1720

1821
import { cn } from "@/lib/utils/cn"
@@ -27,14 +30,17 @@ import CountDown from "./_components/CountDown"
2730
import { adoptionCards, adoptionStyles } from "./_components/data"
2831
import InnovationSwiper from "./_components/InnovationSwiper"
2932
import Stories from "./_components/Stories"
30-
import TenYearGlobe from "./_components/TenYearGlobe"
3133
import TenYearHero from "./_components/TenYearHero"
3234
import { parseStoryDates } from "./_components/utils"
3335

3436
import { fetch10YearEvents } from "@/lib/api/fetch10YearEvents"
3537
import { fetch10YearStories } from "@/lib/api/fetch10YearStories"
3638
import TenYearLogo from "@/public/images/10-year-anniversary/10-year-logo.png"
3739

40+
const TenYearGlobe = dynamic(() => import("./_components/TenYearGlobe"), {
41+
ssr: false,
42+
})
43+
3844
// In seconds
3945
const REVALIDATE_TIME = BASE_TIME_UNIT * 1
4046

@@ -98,16 +104,22 @@ const Page = async ({ params }: { params: Promise<{ locale: Lang }> }) => {
98104
local event or start your own celebration.
99105
</p>
100106
</div>
101-
<div>
102-
<TenYearGlobe
103-
events={Object.values(fetched10YearEvents).flatMap((region) =>
104-
region.events.map((event) => ({
105-
...event,
106-
lat: Number(event.lat),
107-
lng: Number(event.lng),
108-
}))
109-
)}
110-
/>
107+
<div className="h-[max(fit,260px)] sm:h-[400px] md:h-[500px] lg:h-[600px]">
108+
<Suspense
109+
fallback={
110+
<Skeleton className="mx-auto aspect-square h-full rounded-full bg-primary/20 blur-2xl" />
111+
}
112+
>
113+
<TenYearGlobe
114+
events={Object.values(fetched10YearEvents).flatMap((region) =>
115+
region.events.map((event) => ({
116+
...event,
117+
lat: Number(event.lat),
118+
lng: Number(event.lng),
119+
}))
120+
)}
121+
/>
122+
</Suspense>
111123
</div>
112124
</div>
113125
</div>

0 commit comments

Comments
 (0)