Skip to content

Commit 5e58bfb

Browse files
committed
refactor: Morpher lazy loading
1 parent 4d08c4f commit 5e58bfb

File tree

4 files changed

+13
-1
lines changed

4 files changed

+13
-1
lines changed

src/components/Homepage/LanguageMorpher.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"use client"
22

3-
import Morpher from "@/components/Morpher"
3+
import Morpher from "@/components/Morpher/client"
44
import { Button } from "@/components/ui/buttons/Button"
55

66
import { screens } from "@/lib/utils/screen"
File renamed without changes.

src/components/Morpher/loading.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// Blurred text as loader; language insignificant
2+
const Loading = () => <span className="blur-md">ethereum</span>
3+
4+
export default Loading

src/components/Morpher/server.tsx

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+
})

0 commit comments

Comments
 (0)