Skip to content

Commit 0bf5732

Browse files
committed
lazy load torch swiper
1 parent 5c8b6fc commit 0bf5732

File tree

4 files changed

+21
-2
lines changed

4 files changed

+21
-2
lines changed

app/[locale]/10years/_components/TorchHistorySwiper.tsx renamed to app/[locale]/10years/_components/TorchHistorySwiper/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
SwiperNavigation,
1111
} from "@/components/ui/swiper"
1212

13-
import TorchHistoryCard from "./TorchHistoryCard"
13+
import TorchHistoryCard from "../TorchHistoryCard"
1414

1515
import { getAvatarImage, type TorchHolderEvent } from "@/lib/torch"
1616

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import dynamic from "next/dynamic"
2+
3+
import Loading from "./loading"
4+
5+
export default dynamic(() => import("."), { ssr: false, loading: Loading })
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { Skeleton } from "@/components/ui/skeleton"
2+
3+
const Loading = () => (
4+
<div className="flex w-full flex-col items-center gap-6">
5+
<div className="flex w-full items-center justify-center gap-12">
6+
<Skeleton className="h-[400px] w-[240px] rounded-4xl" />
7+
<Skeleton className="h-[400px] w-[240px] rounded-4xl" />
8+
<Skeleton className="h-[400px] w-[240px] rounded-4xl" />
9+
</div>
10+
<Skeleton className="h-6 w-40 rounded-full" />
11+
</div>
12+
)
13+
14+
export default Loading

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import { adoptionStyles } from "./_components/data"
3131
import InnovationSwiper from "./_components/InnovationSwiper/lazy"
3232
import TenYearGlobe from "./_components/TenYearGlobe/lazy"
3333
import TenYearHero from "./_components/TenYearHero"
34-
import TorchHistorySwiper from "./_components/TorchHistorySwiper"
34+
import TorchHistorySwiper from "./_components/TorchHistorySwiper/lazy"
3535
import Stories from "./_components/UserStories/lazy"
3636
import {
3737
getAdoptionCards,

0 commit comments

Comments
 (0)