summaryrefslogtreecommitdiff
path: root/src/pages/index.jsx
diff options
context:
space:
mode:
authorRafi Zadanly <zadanlyr@gmail.com>2023-02-18 22:03:55 +0700
committerRafi Zadanly <zadanlyr@gmail.com>2023-02-18 22:03:55 +0700
commit69f55de26319e570ce0a8c4dbe8a29cb0d0b51c5 (patch)
tree742f6a7f11812b6e236c2cfb69f94aa1b53a49e5 /src/pages/index.jsx
parent8c38ac6b55ce3aa15196364619f8f22053a00c48 (diff)
optimization
Diffstat (limited to 'src/pages/index.jsx')
-rw-r--r--src/pages/index.jsx26
1 files changed, 21 insertions, 5 deletions
diff --git a/src/pages/index.jsx b/src/pages/index.jsx
index 05c6520a..6503ac20 100644
--- a/src/pages/index.jsx
+++ b/src/pages/index.jsx
@@ -1,9 +1,25 @@
+import dynamic from "next/dynamic"
import Seo from "@/core/components/Seo"
-import BasicLayout from "@/core/components/layouts/BasicLayout"
-import CategoryHomeId from "@/lib/home/components/CategoryHomeId"
-import HeroBanner from "@/lib/home/components/HeroBanner"
-import PopularProduct from "@/lib/home/components/PopularProduct"
-import PreferredBrand from "@/lib/home/components/PreferredBrand"
+import ImageSkeleton from "@/core/components/elements/Skeleton/ImageSkeleton"
+import PopularProductSkeleton from "@/lib/home/components/Skeleton/PopularProductSkeleton"
+
+const BasicLayout = dynamic(() => import("@/core/components/layouts/BasicLayout"))
+
+const HeroBanner = dynamic(() => import("@/lib/home/components/HeroBanner"), {
+ loading: <ImageSkeleton />
+})
+
+const PreferredBrand = dynamic(() => import("@/lib/home/components/PreferredBrand"), {
+ loading: <PopularProductSkeleton />
+})
+
+const PopularProduct = dynamic(() => import("@/lib/home/components/PopularProduct"), {
+ loading: <PopularProductSkeleton />
+})
+
+const CategoryHomeId = dynamic(() => import("@/lib/home/components/CategoryHomeId"), {
+ loading: <PopularProductSkeleton />
+})
export default function Home() {
return (