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 From 35c3eaad59dac0f0837dc43d5d4355c7e77803e5 Mon Sep 17 00:00:00 2001 From: it-fixcomart Date: Thu, 29 Aug 2024 16:08:55 +0700 Subject: update mobile view --- src/lib/home/components/CategoryDynamicMobile.jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/lib/home/components/CategoryDynamicMobile.jsx b/src/lib/home/components/CategoryDynamicMobile.jsx index c1433a2d..4d2fa0ec 100644 --- a/src/lib/home/components/CategoryDynamicMobile.jsx +++ b/src/lib/home/components/CategoryDynamicMobile.jsx @@ -59,7 +59,7 @@ const CategoryDynamicMobile = () => { alt={index.name} width={30} height={30} - className='object-' + className='' />
{index.name}
@@ -82,6 +82,7 @@ const CategoryDynamicMobile = () => { alt={x.name} width={40} height={40} + className='p-2' />
{x.name}
-- cgit v1.2.3 From 28691cd9eed9ea4480d978ae83a8a9424caf8ef4 Mon Sep 17 00:00:00 2001 From: it-fixcomart Date: Thu, 29 Aug 2024 16:13:51 +0700 Subject: add pagintion --- src/lib/home/components/CategoryDynamic.jsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/lib/home/components/CategoryDynamic.jsx b/src/lib/home/components/CategoryDynamic.jsx index 7f8a4135..48a60323 100644 --- a/src/lib/home/components/CategoryDynamic.jsx +++ b/src/lib/home/components/CategoryDynamic.jsx @@ -41,15 +41,15 @@ const CategoryDynamic = () => { }, [categoryManagement.isLoading]); const swiperBanner = { - autoplay: { - delay: 6000, - disableOnInteraction: false, - }, - modules: [Pagination, Autoplay], + modules: [Pagination, ], loop: true, classNames:'mySwiper', slidesPerView: 3, spaceBetween:10, + pagination: { + dynamicBullets: true, + clickable: true, + } }; return ( -- cgit v1.2.3