diff options
| author | it-fixcomart <it@fixcomart.co.id> | 2024-07-29 15:23:01 +0700 |
|---|---|---|
| committer | it-fixcomart <it@fixcomart.co.id> | 2024-07-29 15:23:01 +0700 |
| commit | a59ed6e73a599a82d6ef248c57ad29f2ab9cb15d (patch) | |
| tree | d87d37a5dafda05e44123be8a0cf1791d086e3ae /src/lib/home/components/CategoryPilihan.jsx | |
| parent | b951ed0de4285076a71f57a0e440b5e68d4a44bd (diff) | |
<iman> Merge branch 'Feature/category-management' into development
Diffstat (limited to 'src/lib/home/components/CategoryPilihan.jsx')
| -rw-r--r-- | src/lib/home/components/CategoryPilihan.jsx | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/lib/home/components/CategoryPilihan.jsx b/src/lib/home/components/CategoryPilihan.jsx index 5aa1fbcc..6efc1070 100644 --- a/src/lib/home/components/CategoryPilihan.jsx +++ b/src/lib/home/components/CategoryPilihan.jsx @@ -6,11 +6,11 @@ import { useEffect, useState } from 'react'; import { bannerApi } from '../../../api/bannerApi'; const { useQuery } = require('react-query') import { HeroBannerSkeleton } from '../../../components/skeleton/BannerSkeleton'; - +import useCategoryPilihan from '../hooks/useCategoryPilihan'; const CategoryPilihan = ({ id, categories }) => { + const { categoryPilihan } = useCategoryPilihan(); const heroBanner = useQuery('categoryPilihan', bannerApi({ type: 'banner-category-list' })); - return ( <section> <div className='flex flex-row items-center mb-4'> @@ -38,19 +38,19 @@ const CategoryPilihan = ({ id, categories }) => { )} </div> <div className="group/item grid grid-cols-6 gap-y-2 w-full h-full col-span-2 "> - {categories.map((category) => ( - <div key={category.id} className="KartuInti h-48 w-60 max-w-sm lg:max-w-full flex flex-col border-[1px] border-gray-200 relative group"> + {categoryPilihan?.data?.map((category) => ( + <div className="KartuInti h-48 w-60 max-w-sm lg:max-w-full flex flex-col border-[1px] border-gray-200 relative group"> <div className='KartuB absolute h-48 w-60 inset-0 flex items-center justify-center '> <div className="group/edit flex items-center justify-end h-48 w-60 flex-col group-hover/item:visible"> <div className=' h-36 flex justify-end items-end'> - <Image className='group-hover:scale-105 transition-transform duration-300 ' src={category?.image1920? category?.image1920 : '/images/noimage.jpeg'} width={120} height={120} alt={category?.name} /> + <Image className='group-hover:scale-105 transition-transform duration-300 ' src={category?.image? category?.image : '/images/noimage.jpeg'} width={120} height={120} alt={category?.name} /> </div> - <h2 className="text-gray-700 content-center h-12 border-t-[1px] px-1 w-60 border-gray-200 font-normal text-sm text-center">{category?.name}</h2> + <h2 className="text-gray-700 content-center h-12 border-t-[1px] px-1 w-60 border-gray-200 font-normal text-sm text-center">{category?.industries}</h2> </div> </div> <div className='KartuA relative inset-0 flex h-36 w-60 items-center justify-center opacity-0 group-hover:opacity-75 group-hover:bg-[#E20613] transition-opacity '> <Link - href={createSlug('/shop/category/', category?.name, category?.id)} + href={createSlug('/shop/lob/', category?.industries, category?.id)} className='category-mega-box__parent text-white rounded-lg' > Lihat semua |
