From 53d214ef3222bcc4169b188bff3dadf6c43f6b7e Mon Sep 17 00:00:00 2001 From: it-fixcomart Date: Tue, 30 Jul 2024 14:27:23 +0700 Subject: git aMerge branch 'Feature/category-management' into development --- src/lib/home/components/CategoryPilihan.jsx | 142 +++++++++++++++++++--------- 1 file changed, 98 insertions(+), 44 deletions(-) (limited to 'src/lib') diff --git a/src/lib/home/components/CategoryPilihan.jsx b/src/lib/home/components/CategoryPilihan.jsx index 451d289e..6568621c 100644 --- a/src/lib/home/components/CategoryPilihan.jsx +++ b/src/lib/home/components/CategoryPilihan.jsx @@ -7,59 +7,113 @@ import { bannerApi } from '../../../api/bannerApi'; const { useQuery } = require('react-query') import { HeroBannerSkeleton } from '../../../components/skeleton/BannerSkeleton'; import useCategoryPilihan from '../hooks/useCategoryPilihan'; +import useDevice from '@/core/hooks/useDevice' +import { Swiper, SwiperSlide } from 'swiper/react'; +import 'swiper/css'; const CategoryPilihan = ({ id, categories }) => { + const { isDesktop, isMobile } = useDevice() const { categoryPilihan } = useCategoryPilihan(); const heroBanner = useQuery('categoryPilihan', bannerApi({ type: 'banner-category-list' })); return (
-
-
Kategori Pilihan
-

200 Rb+ Produk Unggulan & 800+ Brand Rekomendasi tersedia!

-
-
- {heroBanner.data && - heroBanner.data?.length > 0 && ( -
- {/* {heroBanner.data?.map((banner) => ( */} - - {heroBanner.data[0].name} - - {/* ))} */} + {isDesktop && ( +
+
+
LOB Kategori Pilihan
+

200 Rb+ Produk Unggulan & 800+ Brand Rekomendasi tersedia!

- - )} -
-
- {categoryPilihan?.data?.map((category) => ( -
-
-
-
- {category?.name} -
-

{category?.industries}

+ {heroBanner.data && + heroBanner.data?.length > 0 && ( +
+ + {heroBanner.data[0].name} +
-
-
- - Lihat semua - -
+ )} +
+ {categoryPilihan?.data?.map((category) => ( +
+
+
+
+ {category?.name} +
+

{category?.industries}

+
+
+
+ + Lihat semua + +
+
+ ))} +
+
+ )} + {isMobile && ( +
+
+
LOB Kategori Pilihan
+ {/*

200 Rb+ Produk Unggulan & 800+ Brand Rekomendasi tersedia!

*/}
- ))} -
-
+
+ {heroBanner.data && + heroBanner.data?.length > 0 && ( +
+ + {heroBanner.data[0].name} + +
+ )} +
+ + {categoryPilihan?.data?.map((category) => ( + +
+
+
+
+ {category?.name} +
+

{category?.industries}

+
+
+
+ + Lihat semua + +
+
+
+ ))} + +
+ + + )} + ) } -- cgit v1.2.3