From 6b173eaf8a95432316822b1d41b084875adfbd83 Mon Sep 17 00:00:00 2001
From: "tri.susilo" <tri.susilo@altama.co.id>
Date: Wed, 8 May 2024 14:47:11 +0700
Subject: [agnes] - Feature category management

---
 src/pages/index.jsx | 22 +++++++++++++++++++---
 1 file changed, 19 insertions(+), 3 deletions(-)

(limited to 'src/pages/index.jsx')

diff --git a/src/pages/index.jsx b/src/pages/index.jsx
index c097530c..9675c355 100644
--- a/src/pages/index.jsx
+++ b/src/pages/index.jsx
@@ -1,5 +1,5 @@
 import dynamic from 'next/dynamic';
-import { useRef } from 'react';
+import { useEffect, useRef, useState } from 'react';
 
 import { HeroBannerSkeleton } from '@/components/skeleton/BannerSkeleton';
 import { PopularProductSkeleton } from '@/components/skeleton/PopularProductSkeleton';
@@ -11,6 +11,9 @@ import { FlashSaleSkeleton } from '@/lib/flashSale/skeleton/FlashSaleSkeleton';
 import PreferredBrandSkeleton from '@/lib/home/components/Skeleton/PreferredBrandSkeleton';
 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 { getIdFromSlug } from '@/core/utils/slug'
 
 const BasicLayout = dynamic(() =>
   import('@/core/components/layouts/BasicLayout')
@@ -52,7 +55,7 @@ const CustomerReviews = dynamic(() =>
 );
 const ServiceList = dynamic(() => import('@/lib/home/components/ServiceList'));
 
-export default function Home() {
+export default function Home({categoryId}) {
   const bannerRef = useRef(null);
   const wrapperRef = useRef(null);
 
@@ -61,6 +64,18 @@ export default function Home() {
       bannerRef.current?.querySelector(':first-child')?.clientHeight + 'px';
   };
 
+  const [dataCategories, setDataCategories] = useState([])
+
+  useEffect(() => {
+    const loadCategories = async () => {
+     const getCategories = await odooApi('GET', '/api/v1/category/child?partner_id='+{categoryId})
+     if(getCategories){
+      setDataCategories(getCategories)
+     }
+    }
+    loadCategories()
+  }, [])
+
   return (
     <BasicLayout>
       <Seo
@@ -104,7 +119,8 @@ export default function Home() {
             </div>
             <FlashSale />
             <PromotinProgram />
-            <CategoryHomeId />
+            <CategoryPilihan categories={dataCategories}/>
+            {/* <CategoryHomeId /> */}
             <BannerSection />
             <CustomerReviews />
           </div>
-- 
cgit v1.2.3


From 59cba752134fa41063956569a3f4e7ed2a6d2537 Mon Sep 17 00:00:00 2001
From: it-fixcomart <it@fixcomart.co.id>
Date: Mon, 8 Jul 2024 08:48:29 +0700
Subject: <iman> add dynamic category

---
 src/pages/index.jsx | 2 ++
 1 file changed, 2 insertions(+)

(limited to 'src/pages/index.jsx')

diff --git a/src/pages/index.jsx b/src/pages/index.jsx
index 9675c355..149352c2 100644
--- a/src/pages/index.jsx
+++ b/src/pages/index.jsx
@@ -12,6 +12,7 @@ import PreferredBrandSkeleton from '@/lib/home/components/Skeleton/PreferredBran
 import PromotinProgram from '@/lib/promotinProgram/components/HomePage';
 import PagePopupIformation from '~/modules/popup-information';
 import CategoryPilihan from '../lib/home/components/CategoryPilihan';
+import CategoryDynamic from '../lib/home/components/CategoryDynamic';
 import odooApi from '@/core/api/odooApi';
 import { getIdFromSlug } from '@/core/utils/slug'
 
@@ -120,6 +121,7 @@ export default function Home({categoryId}) {
             <FlashSale />
             <PromotinProgram />
             <CategoryPilihan categories={dataCategories}/>
+            <CategoryDynamic/>
             {/* <CategoryHomeId /> */}
             <BannerSection />
             <CustomerReviews />
-- 
cgit v1.2.3


From 0840f5ccc7493dfa091508db84bad8a21e073268 Mon Sep 17 00:00:00 2001
From: it-fixcomart <it@fixcomart.co.id>
Date: Thu, 18 Jul 2024 17:24:36 +0700
Subject: <iman> update category-management

---
 src/pages/index.jsx | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

(limited to 'src/pages/index.jsx')

diff --git a/src/pages/index.jsx b/src/pages/index.jsx
index 149352c2..b5d004ca 100644
--- a/src/pages/index.jsx
+++ b/src/pages/index.jsx
@@ -12,7 +12,7 @@ import PreferredBrandSkeleton from '@/lib/home/components/Skeleton/PreferredBran
 import PromotinProgram from '@/lib/promotinProgram/components/HomePage';
 import PagePopupIformation from '~/modules/popup-information';
 import CategoryPilihan from '../lib/home/components/CategoryPilihan';
-import CategoryDynamic from '../lib/home/components/CategoryDynamic';
+// import CategoryDynamic from '../lib/home/components/CategoryDynamic';
 import odooApi from '@/core/api/odooApi';
 import { getIdFromSlug } from '@/core/utils/slug'
 
@@ -51,6 +51,11 @@ const BannerSection = dynamic(() =>
 const CategoryHomeId = dynamic(() =>
   import('@/lib/home/components/CategoryHomeId')
 );
+
+const CategoryDynamic = dynamic(() =>
+  import('@/lib/home/components/CategoryDynamic')
+);
+
 const CustomerReviews = dynamic(() =>
   import('@/lib/review/components/CustomerReviews')
 );
@@ -122,7 +127,7 @@ export default function Home({categoryId}) {
             <PromotinProgram />
             <CategoryPilihan categories={dataCategories}/>
             <CategoryDynamic/>
-            {/* <CategoryHomeId /> */}
+            <CategoryHomeId />
             <BannerSection />
             <CustomerReviews />
           </div>
-- 
cgit v1.2.3


From 911e0fdc6beb2f97c7e390a6aec5773202189d68 Mon Sep 17 00:00:00 2001
From: it-fixcomart <it@fixcomart.co.id>
Date: Fri, 19 Jul 2024 17:07:23 +0700
Subject: <iman> update mobile view

---
 src/pages/index.jsx | 8 ++++++++
 1 file changed, 8 insertions(+)

(limited to 'src/pages/index.jsx')

diff --git a/src/pages/index.jsx b/src/pages/index.jsx
index b5d004ca..0255e239 100644
--- a/src/pages/index.jsx
+++ b/src/pages/index.jsx
@@ -56,6 +56,10 @@ const CategoryDynamic = dynamic(() =>
   import('@/lib/home/components/CategoryDynamic')
 );
 
+const CategoryDynamicMobile = dynamic(() =>
+  import('@/lib/home/components/CategoryDynamicMobile')
+);
+
 const CustomerReviews = dynamic(() =>
   import('@/lib/review/components/CustomerReviews')
 );
@@ -153,6 +157,10 @@ export default function Home({categoryId}) {
           <DelayRender renderAfter={600}>
             <PromotinProgram />
           </DelayRender>
+          <DelayRender renderAfter={600}>
+            {/* <CategoryPilihan categories={dataCategories}/> */}
+            <CategoryDynamicMobile/>
+          </DelayRender>
           <DelayRender renderAfter={800}>
             <PopularProduct />
           </DelayRender>
-- 
cgit v1.2.3


From a78251dc5cdfdd5438aad3ce7b7e342fceb7275e Mon Sep 17 00:00:00 2001
From: it-fixcomart <it@fixcomart.co.id>
Date: Mon, 22 Jul 2024 16:57:47 +0700
Subject: <iman> update category management

---
 src/pages/index.jsx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'src/pages/index.jsx')

diff --git a/src/pages/index.jsx b/src/pages/index.jsx
index 0255e239..cdbe0dd0 100644
--- a/src/pages/index.jsx
+++ b/src/pages/index.jsx
@@ -158,7 +158,7 @@ export default function Home({categoryId}) {
             <PromotinProgram />
           </DelayRender>
           <DelayRender renderAfter={600}>
-            {/* <CategoryPilihan categories={dataCategories}/> */}
+            <CategoryPilihan categories={dataCategories}/>
             <CategoryDynamicMobile/>
           </DelayRender>
           <DelayRender renderAfter={800}>
-- 
cgit v1.2.3

