summaryrefslogtreecommitdiff
path: root/src/pages/index.jsx
diff options
context:
space:
mode:
authorit-fixcomart <it@fixcomart.co.id>2024-08-20 16:12:25 +0700
committerit-fixcomart <it@fixcomart.co.id>2024-08-20 16:12:25 +0700
commit5c5eef9d62efd83f52f7c37dacb94d50ff7cb915 (patch)
tree7fdef4f99f0f42e2d99a40bfd5b81f1ca5f4ef30 /src/pages/index.jsx
parent004a9a644aed65d5c02263f19cce8b7c3000f354 (diff)
parent6d302bb338e26810a7f90326b84086217f1f4ae0 (diff)
Merge branch 'release' into Feature/category-management
Diffstat (limited to 'src/pages/index.jsx')
-rw-r--r--src/pages/index.jsx48
1 files changed, 29 insertions, 19 deletions
diff --git a/src/pages/index.jsx b/src/pages/index.jsx
index 9d9d5dc0..4d6e59e0 100644
--- a/src/pages/index.jsx
+++ b/src/pages/index.jsx
@@ -8,12 +8,14 @@ import DesktopView from '@/core/components/views/DesktopView';
import MobileView from '@/core/components/views/MobileView';
import { FlashSaleSkeleton } from '@/lib/flashSale/skeleton/FlashSaleSkeleton';
import PreferredBrandSkeleton from '@/lib/home/components/Skeleton/PreferredBrandSkeleton';
+import BannerPromoSkeleton from '@/lib/home/components/Skeleton/BannerPromoSkeleton';
import PromotinProgram from '@/lib/promotinProgram/components/HomePage';
import PagePopupIformation from '~/modules/popup-information';
import CategoryPilihan from '../lib/home/components/CategoryPilihan';
import odooApi from '@/core/api/odooApi';
import { getAuth } from '~/libs/auth';
// import { getAuth } from '~/libs/auth';
+import useProductDetail from '~/modules/product-detail/stores/useProductDetail';
const BasicLayout = dynamic(() =>
import('@/core/components/layouts/BasicLayout')
@@ -45,9 +47,12 @@ const FlashSale = dynamic(
}
);
-// const ProgramPromotion = dynamic(() =>
-// import('@/lib/home/components/PromotionProgram')
-// );
+const ProgramPromotion = dynamic(() =>
+ import('@/lib/home/components/PromotionProgram'),
+{
+ loading: () => <BannerPromoSkeleton />,
+}
+);
const BannerSection = dynamic(() =>
import('@/lib/home/components/BannerSection')
@@ -93,8 +98,8 @@ export default function Home({categoryId}) {
}, [])
const [dataCategories, setDataCategories] = useState([])
-
return (
+ <>
<BasicLayout>
<Seo
title='Indoteknik.com: B2B Industrial Supply & Solution'
@@ -102,11 +107,9 @@ export default function Home({categoryId}) {
additionalMetaTags={[
{
name: 'keywords',
- content:
- 'indoteknik, indoteknik.com, toko teknik, toko perkakas, jual genset, jual fogging, jual krisbow, harga krisbow, harga alat safety, harga pompa air',
+ content: 'indoteknik, indoteknik.com, toko teknik, toko perkakas, jual genset, jual fogging, jual krisbow, harga krisbow, harga alat safety, harga pompa air',
},
- ]}
- />
+ ]} />
<PagePopupIformation />
@@ -131,28 +134,32 @@ export default function Home({categoryId}) {
</div>
<div className='my-16 flex flex-col gap-y-8'>
- <div className='my-16 flex flex-col gap-y-8'>
<ServiceList />
<div id='flashsale'>
<PreferredBrand />
</div>
{!auth?.feature?.soApproval && (
<>
- {/* <ProgramPromotion /> <FlashSale /> */}
+ <DelayRender renderAfter={200}>
+ <ProgramPromotion />
+ </DelayRender>
+ <DelayRender renderAfter={200}>
+ <FlashSale />
+ </DelayRender>
</>
)}
<PromotinProgram />
- <CategoryPilihan categories={dataCategories}/>
- <CategoryDynamic/>
+ {dataCategories &&(
+ <CategoryPilihan categories={dataCategories} />
+ )}
+ <CategoryDynamic />
<CategoryHomeId />
<BannerSection />
<CustomerReviews />
</div>
- </div>
</div>
- </DesktopView>
-
- <MobileView>
+ </DesktopView>
+ <MobileView>
<DelayRender renderAfter={200}>
<HeroBanner />
</DelayRender>
@@ -168,7 +175,7 @@ export default function Home({categoryId}) {
{!auth?.feature?.soApproval && (
<>
<DelayRender renderAfter={400}>
- {/* <ProgramPromotion /> */}
+ <ProgramPromotion />
</DelayRender>
<DelayRender renderAfter={600}>
<FlashSale />
@@ -179,8 +186,10 @@ export default function Home({categoryId}) {
<PromotinProgram />
</DelayRender>
<DelayRender renderAfter={600}>
- <CategoryPilihan categories={dataCategories}/>
- <CategoryDynamicMobile/>
+ {dataCategories &&(
+ <CategoryPilihan categories={dataCategories} />
+ )}
+ <CategoryDynamicMobile />
</DelayRender>
<DelayRender renderAfter={800}>
<PopularProduct />
@@ -195,5 +204,6 @@ export default function Home({categoryId}) {
</div>
</MobileView>
</BasicLayout>
+ </>
);
} \ No newline at end of file