From a1e4d12c041dc8f06de531a9f7f287e07ccc81e8 Mon Sep 17 00:00:00 2001
From: it-fixcomart <it@fixcomart.co.id>
Date: Mon, 18 Nov 2024 16:54:53 +0700
Subject: <iman> delete categories

---
 src/pages/index.jsx | 237 +++++++++++++++++++++++++---------------------------
 1 file changed, 113 insertions(+), 124 deletions(-)

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

diff --git a/src/pages/index.jsx b/src/pages/index.jsx
index cc4d68db..2ec1231a 100644
--- a/src/pages/index.jsx
+++ b/src/pages/index.jsx
@@ -45,18 +45,19 @@ const FlashSale = dynamic(
   }
 );
 
-const ProgramPromotion = dynamic(() =>
-  import('@/lib/home/components/PromotionProgram'),
-{
-  loading: () => <BannerPromoSkeleton />,
-}
+const ProgramPromotion = dynamic(
+  () => import('@/lib/home/components/PromotionProgram'),
+  {
+    loading: () => <BannerPromoSkeleton />,
+  }
 );
 
 const BannerSection = dynamic(() =>
   import('@/lib/home/components/BannerSection')
-);  
-const CategoryHomeId = dynamic(() =>
-  import('@/lib/home/components/CategoryHomeId'), {ssr: false}
+);
+const CategoryHomeId = dynamic(
+  () => import('@/lib/home/components/CategoryHomeId'),
+  { ssr: false }
 );
 
 const CategoryDynamic = dynamic(() =>
@@ -64,17 +65,18 @@ const CategoryDynamic = dynamic(() =>
 );
 
 const CategoryDynamicMobile = dynamic(() =>
-import('@/lib/home/components/CategoryDynamicMobile')
+  import('@/lib/home/components/CategoryDynamicMobile')
 );
 
-const CustomerReviews = dynamic(() =>
-  import('@/lib/review/components/CustomerReviews'), {ssr: false}
+const CustomerReviews = dynamic(
+  () => import('@/lib/review/components/CustomerReviews'),
+  { ssr: false }
 ); // need to ssr:false
-const ServiceList = dynamic(() => import('@/lib/home/components/ServiceList'), {ssr: false}); // need to ssr: false
+const ServiceList = dynamic(() => import('@/lib/home/components/ServiceList'), {
+  ssr: false,
+}); // need to ssr: false
 
-
-
-export default function Home({categoryId}) {
+export default function Home({ categoryId }) {
   const bannerRef = useRef(null);
   const wrapperRef = useRef(null);
 
@@ -85,123 +87,110 @@ export default function Home({categoryId}) {
       bannerRef.current?.querySelector(':first-child')?.clientHeight + 'px';
   };
 
-  useEffect(() => {
-    const loadCategories = async () => {
-     const getCategories = await odooApi('GET', '/api/v1/category/child?partner_id='+{categoryId})
-     if(getCategories){
-      setDataCategories(getCategories)
-     }
-    }
-    loadCategories()
-  }, [])
-
-  const [dataCategories, setDataCategories] = useState([])
   return (
     <>
-    <BasicLayout>
-      <Seo
-        title='Indoteknik.com: B2B Industrial Supply & Solution'
-        description='Temukan pilihan produk B2B Industri &amp; Alat Teknik untuk Perusahaan, UMKM &amp; Pemerintah dengan lengkap, mudah dan transparan.'
-        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',
-          },
-        ]} />
-
-      <PagePopupIformation />
-
-      <DesktopView>
-        <div className='container mx-auto'>
-          <div
-            className='flex min-h-[400px] h-[460px]'
-            ref={wrapperRef}
-            onLoad={handleOnLoad}
-          >
-            <div className='w-2/12'>
-              <HeroBannerSecondary />
-            </div>
-            <div className='w-7/12 px-1' ref={bannerRef}>
-              <HeroBanner />
+      <BasicLayout>
+        <Seo
+          title='Indoteknik.com: B2B Industrial Supply & Solution'
+          description='Temukan pilihan produk B2B Industri &amp; Alat Teknik untuk Perusahaan, UMKM &amp; Pemerintah dengan lengkap, mudah dan transparan.'
+          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',
+            },
+          ]}
+        />
+
+        <PagePopupIformation />
+
+        <DesktopView>
+          <div className='container mx-auto'>
+            <div
+              className='flex min-h-[400px] h-[460px]'
+              ref={wrapperRef}
+              onLoad={handleOnLoad}
+            >
+              <div className='w-2/12'>
+                <HeroBannerSecondary />
+              </div>
+              <div className='w-7/12 px-1' ref={bannerRef}>
+                <HeroBanner />
+              </div>
+              <div className='w-3/12'>
+                <DelayRender renderAfter={200}>
+                  <PopularProduct />
+                </DelayRender>
+              </div>
             </div>
-            <div className='w-3/12'>
-              <DelayRender renderAfter={200}>
-                <PopularProduct />
-              </DelayRender>
-            </div>
-          </div>
 
-          <div className='my-16 flex flex-col gap-y-8'>
-            <ServiceList />
-            <div id='flashsale'>
-              <PreferredBrand />
+            <div className='my-16 flex flex-col gap-y-8'>
+              <ServiceList />
+              <div id='flashsale'>
+                <PreferredBrand />
+              </div>
+              {!auth?.feature?.soApproval && (
+                <>
+                  <DelayRender renderAfter={200}>
+                    <ProgramPromotion />
+                  </DelayRender>
+                  <DelayRender renderAfter={200}>
+                    <FlashSale />
+                  </DelayRender>
+                </>
+              )}
+              {/* <PromotinProgram /> */}
+              <CategoryPilihan />
+              <CategoryDynamic />
+              <CategoryHomeId />
+              <BannerSection />
+              <CustomerReviews />
             </div>
+          </div>
+        </DesktopView>
+        <MobileView>
+          <DelayRender renderAfter={200}>
+            <HeroBanner />
+          </DelayRender>
+          <div className='flex flex-col gap-y-4 my-6'>
+            <DelayRender renderAfter={400}>
+              <ServiceList />
+            </DelayRender>
+            <DelayRender renderAfter={400}>
+              <div id='flashsale'>
+                <PreferredBrand />
+              </div>
+            </DelayRender>
             {!auth?.feature?.soApproval && (
               <>
-              <DelayRender renderAfter={200}>
-                <ProgramPromotion />
-              </DelayRender>
-              <DelayRender renderAfter={200}>
-                <FlashSale />
-              </DelayRender>
+                <DelayRender renderAfter={400}>
+                  <ProgramPromotion />
+                </DelayRender>
+                <DelayRender renderAfter={600}>
+                  <FlashSale />
+                </DelayRender>
               </>
             )}
-            {/* <PromotinProgram /> */}
-            {dataCategories &&(
-              <CategoryPilihan categories={dataCategories} />
-            )}
-            <CategoryDynamic /> 
-            <CategoryHomeId />
-            <BannerSection />
-            <CustomerReviews />
+            <DelayRender renderAfter={600}>
+              {/* <PromotinProgram /> */}
+            </DelayRender>
+            <DelayRender renderAfter={600}>
+              <CategoryPilihan />
+              <CategoryDynamicMobile />
+            </DelayRender>
+            <DelayRender renderAfter={800}>
+              <PopularProduct />
+            </DelayRender>
+            <DelayRender renderAfter={1000}>
+              <CategoryHomeId />
+              <BannerSection />
+            </DelayRender>
+            <DelayRender renderAfter={1200}>
+              <CustomerReviews />
+            </DelayRender>
           </div>
-        </div>
-    </DesktopView>
-    <MobileView>
-        <DelayRender renderAfter={200}>
-          <HeroBanner />
-        </DelayRender>
-        <div className='flex flex-col gap-y-4 my-6'>
-          <DelayRender renderAfter={400}>
-            <ServiceList />
-          </DelayRender>
-          <DelayRender renderAfter={400}>
-            <div id='flashsale'>
-              <PreferredBrand />
-            </div>
-          </DelayRender>
-          {!auth?.feature?.soApproval && (
-            <>
-              <DelayRender renderAfter={400}>
-                <ProgramPromotion />
-              </DelayRender>
-              <DelayRender renderAfter={600}>
-                <FlashSale />
-              </DelayRender>
-            </>
-          )}
-          <DelayRender renderAfter={600}>
-            {/* <PromotinProgram /> */}
-          </DelayRender>
-          <DelayRender renderAfter={600}>
-            {dataCategories &&(
-              <CategoryPilihan categories={dataCategories} />
-            )}
-            <CategoryDynamicMobile />
-          </DelayRender>
-          <DelayRender renderAfter={800}>
-            <PopularProduct />
-          </DelayRender>
-          <DelayRender renderAfter={1000}>
-            <CategoryHomeId />
-            <BannerSection />
-          </DelayRender>
-          <DelayRender renderAfter={1200}>
-            <CustomerReviews />
-          </DelayRender>
-        </div>
-      </MobileView>
-    </BasicLayout>
-  </>
+        </MobileView>
+      </BasicLayout>
+    </>
   );
-}
\ No newline at end of file
+}
-- 
cgit v1.2.3

