Skip to content

Commit f5d172c

Browse files
committed
refactor: client, loading, server component breakdown
1 parent c873649 commit f5d172c

File tree

9 files changed

+43
-38
lines changed

9 files changed

+43
-38
lines changed

app/[locale]/what-is-ethereum/_components/WhatTabs/lazy.tsx

Lines changed: 0 additions & 20 deletions
This file was deleted.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { Skeleton, SkeletonLines } from "@/components/ui/skeleton"
2+
3+
const Loading = () => (
4+
<>
5+
<div className="mb-4 flex w-2/3 gap-4 border-b py-4">
6+
<Skeleton className="flex-1" />
7+
<Skeleton className="flex-1" />
8+
</div>
9+
<div className="h-fit rounded-lg border p-8">
10+
<SkeletonLines noOfLines={5} className="pt-0" />
11+
</div>
12+
</>
13+
)
14+
export default Loading
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import dynamic from "next/dynamic"
2+
3+
import Loading from "./loading"
4+
5+
export default dynamic(() => import("./client"), {
6+
ssr: false,
7+
loading: Loading,
8+
})

app/[locale]/what-is-ethereum/_components/WhySwiper/lazy.tsx

Lines changed: 0 additions & 16 deletions
This file was deleted.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { Skeleton, SkeletonLines } from "@/components/ui/skeleton"
2+
3+
const Loading = () => (
4+
<div className="h-fit space-y-8 rounded border bg-background p-8">
5+
<SkeletonLines noOfLines={5} />
6+
<SkeletonLines noOfLines={5} />
7+
<Skeleton className="mx-auto h-5 w-40 rounded-full" />
8+
</div>
9+
)
10+
11+
export default Loading
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import dynamic from "next/dynamic"
2+
3+
import Loading from "./loading"
4+
5+
export default dynamic(() => import("./client"), {
6+
ssr: false,
7+
loading: Loading,
8+
})

app/[locale]/what-is-ethereum/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ import {
4343
getRequiredNamespacesForPage,
4444
} from "@/lib/utils/translations"
4545

46-
import WhatTabs from "./_components/WhatTabs/lazy"
47-
import WhySwiper from "./_components/WhySwiper/lazy"
46+
import WhatTabs from "./_components/WhatTabs/server"
47+
import WhySwiper from "./_components/WhySwiper/server"
4848

4949
import { fetchGrowThePie } from "@/lib/api/fetchGrowThePie"
5050
import dogeComputerImg from "@/public/images/doge-computer.png"

0 commit comments

Comments
 (0)