summaryrefslogtreecommitdiff
path: root/src/pages
diff options
context:
space:
mode:
authorHATEC\SPVDEV001 <tri.susilo@altama.co.id>2023-08-09 10:47:44 +0700
committerHATEC\SPVDEV001 <tri.susilo@altama.co.id>2023-08-09 10:47:44 +0700
commit407af81fb2d9ebdf3415fe7b34d08996ed7c80ec (patch)
tree675d0981a6259b814c3deb7bd053a85892fea53b /src/pages
parent9595223471946520f5c156e24eceb577fae4c901 (diff)
parent863047e92834479ce8edb576b57b129c611821a8 (diff)
Merge branch 'master' into CR/flash_sale
# Conflicts: # src/lib/product/components/ProductCard.jsx
Diffstat (limited to 'src/pages')
-rw-r--r--src/pages/_app.jsx1
-rw-r--r--src/pages/index.jsx36
2 files changed, 17 insertions, 20 deletions
diff --git a/src/pages/_app.jsx b/src/pages/_app.jsx
index 4c4fed89..03147219 100644
--- a/src/pages/_app.jsx
+++ b/src/pages/_app.jsx
@@ -1,4 +1,5 @@
import '../styles/globals.css'
+import 'react-loading-skeleton/dist/skeleton.css'
import NextProgress from 'next-progress'
import { useRouter, Router } from 'next/router'
import { AnimatePresence, motion } from 'framer-motion'
diff --git a/src/pages/index.jsx b/src/pages/index.jsx
index 12d2ab46..47a0a493 100644
--- a/src/pages/index.jsx
+++ b/src/pages/index.jsx
@@ -7,6 +7,8 @@ import DelayRender from '@/core/components/elements/DelayRender/DelayRender'
import { HeroBannerSkeleton } from '@/components/skeleton/BannerSkeleton'
import { PopularProductSkeleton } from '@/components/skeleton/PopularProductSkeleton'
import PromotinProgram from '@/lib/promotinProgram/components/HomePage'
+import PreferredBrandSkeleton from '@/lib/home/components/Skeleton/PreferredBrandSkeleton'
+import { FlashSaleSkeleton } from '@/lib/flashSale/skeleton/FlashSaleSkeleton'
const BasicLayout = dynamic(() => import('@/core/components/layouts/BasicLayout'))
const HeroBanner = dynamic(() => import('@/components/ui/HeroBanner'), {
@@ -19,9 +21,13 @@ const PopularProduct = dynamic(() => import('@/components/ui/PopularProduct'), {
loading: () => <PopularProductSkeleton />
})
-const PreferredBrand = dynamic(() => import('@/lib/home/components/PreferredBrand'))
+const PreferredBrand = dynamic(() => import('@/lib/home/components/PreferredBrand'), {
+ loading: () => <PreferredBrandSkeleton />
+})
-const FlashSale = dynamic(() => import('@/lib/flashSale/components/FlashSale'))
+const FlashSale = dynamic(() => import('@/lib/flashSale/components/FlashSale'), {
+ loading: () => <FlashSaleSkeleton />
+})
const BannerSection = dynamic(() => import('@/lib/home/components/BannerSection'))
const CategoryHomeId = dynamic(() => import('@/lib/home/components/CategoryHomeId'))
const CustomerReviews = dynamic(() => import('@/lib/review/components/CustomerReviews'))
@@ -66,22 +72,12 @@ export default function Home() {
</div>
<div className='my-16 flex flex-col gap-y-16'>
- <DelayRender renderAfter={400}>
- <PreferredBrand />
- </DelayRender>
- <DelayRender renderAfter={600}>
- <FlashSale />
- </DelayRender>
- <DelayRender renderAfter={600}>
- <PromotinProgram />
- </DelayRender>
- <DelayRender renderAfter={1000}>
- <CategoryHomeId />
- <BannerSection />
- </DelayRender>
- <DelayRender renderAfter={1200}>
- <CustomerReviews />
- </DelayRender>
+ <PreferredBrand />
+ <FlashSale />
+ <PromotinProgram />
+ <CategoryHomeId />
+ <BannerSection />
+ <CustomerReviews />
</div>
</div>
</DesktopView>
@@ -98,8 +94,8 @@ export default function Home() {
<FlashSale />
</DelayRender>
<DelayRender renderAfter={600}>
- <PromotinProgram />
- </DelayRender>
+ <PromotinProgram />
+ </DelayRender>
<DelayRender renderAfter={800}>
<PopularProduct />
</DelayRender>