From 266d123ea9a2516913aa6f72d8c5855aea99652c Mon Sep 17 00:00:00 2001 From: it-fixcomart Date: Thu, 29 Aug 2024 15:42:22 +0700 Subject: update navbar category link & change category dynamic to slider --- .../components/elements/Navbar/NavbarDesktop.jsx | 5 +- src/lib/home/components/CategoryDynamic.jsx | 130 ++++++++++++--------- 2 files changed, 78 insertions(+), 57 deletions(-) (limited to 'src') diff --git a/src/core/components/elements/Navbar/NavbarDesktop.jsx b/src/core/components/elements/Navbar/NavbarDesktop.jsx index 6c308f11..d3f53950 100644 --- a/src/core/components/elements/Navbar/NavbarDesktop.jsx +++ b/src/core/components/elements/Navbar/NavbarDesktop.jsx @@ -225,8 +225,7 @@ const NavbarDesktop = () => {
-
- +
{ const { categoryManagement } = useCategoryManagement(); @@ -34,6 +39,18 @@ const CategoryDynamic = () => { fetchCategoryData(); }, [categoryManagement.isLoading]); + + const swiperBanner = { + autoplay: { + delay: 6000, + disableOnInteraction: false, + }, + modules: [Pagination, Autoplay], + loop: true, + classNames:'mySwiper', + slidesPerView: 3, + spaceBetween:10, + }; return (
@@ -42,64 +59,69 @@ const CategoryDynamic = () => { return ( -
-
-
{category.name}
- -

{countLevel1} Produk tersedia

-
- Lihat Semua -
-
- {category.categories.map((subCategory) => { - const countLevel2 = subCategoryData[subCategory.idLevel2] || 0; +
+
+
{category.name}
+ +

{countLevel1} Produk tersedia

+
+ Lihat Semua +
+ + {/* Swiper for SubCategories */} + + {category.categories.map((subCategory) => { + const countLevel2 = subCategoryData[subCategory.idLevel2] || 0; - return ( -
-
-
- -
-
{subCategory.name}
- -

- {countLevel2} Produk tersedia -

-
- Lihat Semua -
-
-
- {subCategory.childFrontendIdI.map((childCategory) => ( -
- - -
-
{childCategory.name}
+ return ( + +
+
+
+ +
+
{subCategory.name}
+ +

+ {countLevel2} Produk tersedia +

+
+ Lihat Semua +
+
+
+ {subCategory.childFrontendIdI.map((childCategory) => ( +
+ + +
+
{childCategory.name}
+
+
- + ))}
- ))} +
-
-
- ); - })} + + ); + })} +
-
- + ); })}
-- cgit v1.2.3