From 36601aba6017aeef16f89351eb487238402ab52e Mon Sep 17 00:00:00 2001 From: it-fixcomart Date: Tue, 24 Sep 2024 16:12:50 +0700 Subject: update Perapihan Tag --- src/lib/home/components/BannerSection.jsx | 20 +- src/lib/home/components/CategoryDynamic.jsx | 15 +- src/lib/home/components/CategoryDynamicMobile.jsx | 14 +- src/lib/home/components/CategoryHomeId.jsx | 18 +- src/lib/home/components/CategoryPilihan.jsx | 265 +++++++++++++--------- src/lib/home/components/PromotionProgram.jsx | 118 +++++----- src/lib/home/components/ServiceList.jsx | 34 +-- 7 files changed, 273 insertions(+), 211 deletions(-) (limited to 'src/lib/home/components') diff --git a/src/lib/home/components/BannerSection.jsx b/src/lib/home/components/BannerSection.jsx index 2010503d..f83c36fc 100644 --- a/src/lib/home/components/BannerSection.jsx +++ b/src/lib/home/components/BannerSection.jsx @@ -1,12 +1,12 @@ -import Link from '@/core/components/elements/Link/Link' -import Image from 'next/image' +import Link from '@/core/components/elements/Link/Link'; +import Image from 'next/image'; -const { useQuery } = require('react-query') -const { default: bannerSectionApi } = require('../api/bannerSectionApi') +const { useQuery } = require('react-query'); +const { default: bannerSectionApi } = require('../api/bannerSectionApi'); const BannerSection = () => { - const fetchBannerSection = async () => await bannerSectionApi() - const bannerSection = useQuery('bannerSection', fetchBannerSection) + const fetchBannerSection = async () => await bannerSectionApi(); + const bannerSection = useQuery('bannerSection', fetchBannerSection); return ( bannerSection.data && @@ -17,7 +17,7 @@ const BannerSection = () => { {banner.name} { ))} ) - ) -} + ); +}; -export default BannerSection +export default BannerSection; diff --git a/src/lib/home/components/CategoryDynamic.jsx b/src/lib/home/components/CategoryDynamic.jsx index 79092c9d..49a9a93f 100644 --- a/src/lib/home/components/CategoryDynamic.jsx +++ b/src/lib/home/components/CategoryDynamic.jsx @@ -3,13 +3,12 @@ import { fetchCategoryManagementSolr } from '../api/categoryManagementApi'; import NextImage from 'next/image'; import Link from 'next/link'; import { createSlug } from '@/core/utils/slug'; -import odooApi from '@/core/api/odooApi'; import { Skeleton } from '@chakra-ui/react'; import { Swiper, SwiperSlide } from 'swiper/react'; import 'swiper/css'; import 'swiper/css/navigation'; import 'swiper/css/pagination'; -import { Navigation, Pagination, Autoplay } from 'swiper'; +import { Pagination } from 'swiper'; const CategoryDynamic = () => { const [categoryManagement, setCategoryManagement] = useState([]); @@ -73,9 +72,9 @@ const CategoryDynamic = () => {
-
+

{category.name} -

+ {/*

{countLevel1} Produk tersedia

*/} @@ -113,9 +112,9 @@ const CategoryDynamic = () => { className='object-fit p-4' />
-
+

{subCategory?.name} -

+ {/*

{countLevel2} Produk tersedia @@ -157,9 +156,9 @@ const CategoryDynamic = () => { height={40} />

-
+

{childCategory.name} -

+
diff --git a/src/lib/home/components/CategoryDynamicMobile.jsx b/src/lib/home/components/CategoryDynamicMobile.jsx index af151df2..4a8f13cf 100644 --- a/src/lib/home/components/CategoryDynamicMobile.jsx +++ b/src/lib/home/components/CategoryDynamicMobile.jsx @@ -59,9 +59,9 @@ const CategoryDynamicMobile = () => { categoryManagement?.map((category) => (
-
- {category?.name} -
+

+ {category.name} +

{ className='' />
-
+

{index?.name} -

+
@@ -131,9 +131,9 @@ const CategoryDynamicMobile = () => { className='p-2' />
-
+

{x?.name} -

+
diff --git a/src/lib/home/components/CategoryHomeId.jsx b/src/lib/home/components/CategoryHomeId.jsx index 71428e27..9f436dac 100644 --- a/src/lib/home/components/CategoryHomeId.jsx +++ b/src/lib/home/components/CategoryHomeId.jsx @@ -1,13 +1,15 @@ -import { LazyLoadComponent } from 'react-lazy-load-image-component' -import useCategoryHomeId from '../hooks/useCategoryHomeId' -import CategoryHome from './CategoryHome' +import { LazyLoadComponent } from 'react-lazy-load-image-component'; +import useCategoryHomeId from '../hooks/useCategoryHomeId'; +import CategoryHome from './CategoryHome'; const CategoryHomeId = () => { - const { categoryHomeIds } = useCategoryHomeId() + const { categoryHomeIds } = useCategoryHomeId(); return (
-
Kategori Pilihan
+

+ Kategori Pilihan +

{categoryHomeIds.data?.map((id) => ( @@ -16,7 +18,7 @@ const CategoryHomeId = () => { ))}
- ) -} + ); +}; -export default CategoryHomeId +export default CategoryHomeId; diff --git a/src/lib/home/components/CategoryPilihan.jsx b/src/lib/home/components/CategoryPilihan.jsx index 6dbf771e..2e5ca721 100644 --- a/src/lib/home/components/CategoryPilihan.jsx +++ b/src/lib/home/components/CategoryPilihan.jsx @@ -1,123 +1,168 @@ -import Image from 'next/image' -import useCategoryHome from '../hooks/useCategoryHome' -import Link from '@/core/components/elements/Link/Link' -import { createSlug } from '@/core/utils/slug' +import Image from 'next/image'; +import useCategoryHome from '../hooks/useCategoryHome'; +import Link from '@/core/components/elements/Link/Link'; +import { createSlug } from '@/core/utils/slug'; import { useEffect, useState } from 'react'; import { bannerApi } from '../../../api/bannerApi'; -const { useQuery } = require('react-query') +const { useQuery } = require('react-query'); import { HeroBannerSkeleton } from '../../../components/skeleton/BannerSkeleton'; import useCategoryPilihan from '../hooks/useCategoryPilihan'; -import useDevice from '@/core/hooks/useDevice' +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 ( - categoryPilihan.length > 0 && ( -
- {isDesktop && ( -
-
-
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 - -
-
- ))} + const { isDesktop, isMobile } = useDevice(); + const { categoryPilihan } = useCategoryPilihan(); + const heroBanner = useQuery( + 'categoryPilihan', + bannerApi({ type: 'banner-category-list' }) + ); + return ( + categoryPilihan.length > 0 && ( +
+ {isDesktop && ( +
+
+
+ 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 + +
- )} - {isMobile && ( -
-
-
LOB Kategori Pilihan
- {/*

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

*/} + ))} +
+
+ )} + {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} +

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

{category?.industries}

-
-
-
- - Lihat semua - -
-
-
- ))} - -
- -
- )} -
- - ) - ) -} +
+ + ))} + +
+ )} +
+ ) + ); +}; -export default CategoryPilihan +export default CategoryPilihan; diff --git a/src/lib/home/components/PromotionProgram.jsx b/src/lib/home/components/PromotionProgram.jsx index ae8d5d6f..ae06bd4d 100644 --- a/src/lib/home/components/PromotionProgram.jsx +++ b/src/lib/home/components/PromotionProgram.jsx @@ -1,13 +1,16 @@ -import Link from '@/core/components/elements/Link/Link' -import Image from 'next/image' +import Link from '@/core/components/elements/Link/Link'; +import Image from 'next/image'; import { bannerApi } from '@/api/bannerApi'; -import useDevice from '@/core/hooks/useDevice' +import useDevice from '@/core/hooks/useDevice'; import { Swiper, SwiperSlide } from 'swiper/react'; -import BannerPromoSkeleton from '../components/Skeleton/BannerPromoSkeleton'; -const { useQuery } = require('react-query') +import BannerPromoSkeleton from '../components/Skeleton/BannerPromoSkeleton'; +const { useQuery } = require('react-query'); const BannerSection = () => { - const promotionProgram = useQuery('promotionProgram', bannerApi({ type: 'banner-promotion' })); - const { isMobile, isDesktop } = useDevice() + const promotionProgram = useQuery( + 'promotionProgram', + bannerApi({ type: 'banner-promotion' }) + ); + const { isMobile, isDesktop } = useDevice(); if (promotionProgram.isLoading) { return ; @@ -16,60 +19,65 @@ const BannerSection = () => { return (
-

Promo Tersedia

+

+ {' '} + + Promo Tersedia + +

{isDesktop && ( - Lihat Semua - + Lihat Semua + )} {isMobile && ( - - Lihat Semua - - )} -
- {isDesktop && (promotionProgram.data && - promotionProgram.data?.length > 0 && ( -
- {promotionProgram.data?.map((banner) => ( - - {banner.name} + + Lihat Semua - ))} + )}
- - ))} + {isDesktop && + promotionProgram.data && + promotionProgram.data?.length > 0 && ( +
+ {promotionProgram.data?.map((banner) => ( + + {banner.name} + + ))} +
+ )} -{isMobile && ( - - - {promotionProgram.data?.map((banner) => ( - - - {banner.name} - - - ))} - - - )} + {isMobile && ( + + {promotionProgram.data?.map((banner) => ( + + + {banner.name} + + + ))} + + )}
- - ) -} + ); +}; -export default BannerSection +export default BannerSection; diff --git a/src/lib/home/components/ServiceList.jsx b/src/lib/home/components/ServiceList.jsx index b8799d7d..5b16915d 100644 --- a/src/lib/home/components/ServiceList.jsx +++ b/src/lib/home/components/ServiceList.jsx @@ -1,5 +1,5 @@ -import Image from 'next/image' -import Link from '@/core/components/elements/Link/Link' +import Image from 'next/image'; +import Link from '@/core/components/elements/Link/Link'; const ServiceList = () => { return ( @@ -14,14 +14,16 @@ const ServiceList = () => {
-

One Stop Solution

+

+ One Stop Solution +

Temukan Solusi Lengkap Anda dalam Satu Tempat.

@@ -37,14 +39,16 @@ const ServiceList = () => {
-

Garansi Resmi

+

+ Garansi Resmi +

Garansi Keaslian Barang dan Jaminan Purna Jual.

@@ -60,14 +64,16 @@ const ServiceList = () => {
-

Pembayaran Tempo

+

+ Pembayaran Tempo +

Lebih mudah mengatur pembelian dengan pembayaran tempo.

@@ -83,14 +89,16 @@ const ServiceList = () => {
-

Faktur Pajak

+

+ Faktur Pajak +

Dapat Faktur pajak untuk setiap transaksi dengan indoteknik.com

@@ -99,7 +107,7 @@ const ServiceList = () => {
- ) -} + ); +}; -export default ServiceList +export default ServiceList; -- cgit v1.2.3