From a1e4d12c041dc8f06de531a9f7f287e07ccc81e8 Mon Sep 17 00:00:00 2001 From: it-fixcomart Date: Mon, 18 Nov 2024 16:54:53 +0700 Subject: delete categories --- src/pages/index.jsx | 237 +++++++++++++++++++++++++--------------------------- 1 file changed, 113 insertions(+), 124 deletions(-) (limited to 'src') 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: () => , -} +const ProgramPromotion = dynamic( + () => import('@/lib/home/components/PromotionProgram'), + { + loading: () => , + } ); 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 ( <> - - - - - - -
-
-
- -
-
- + + + + + + +
+
+
+ +
+
+ +
+
+ + + +
-
- - - -
-
-
- -
- +
+ +
+ +
+ {!auth?.feature?.soApproval && ( + <> + + + + + + + + )} + {/* */} + + + + +
+
+ + + + + +
+ + + + +
+ +
+
{!auth?.feature?.soApproval && ( <> - - - - - - + + + + + + )} - {/* */} - {dataCategories &&( - - )} - - - - + + {/* */} + + + + + + + + + + + + + + +
-
-
- - - - -
- - - - -
- -
-
- {!auth?.feature?.soApproval && ( - <> - - - - - - - - )} - - {/* */} - - - {dataCategories &&( - - )} - - - - - - - - - - - - -
-
-
- + + + ); -} \ No newline at end of file +} -- cgit v1.2.3