increable offers + fix bugs
This commit is contained in:
@@ -4,9 +4,19 @@ import ProductCard from '@/components/ProductCard'
|
||||
import Image from 'next/image'
|
||||
import { Swiper, SwiperSlide } from 'swiper/react'
|
||||
import { SHOP_CONFIG } from '@/config/const'
|
||||
import { useGetLanding } from '../hooks/useHomeData'
|
||||
|
||||
|
||||
const HotOffer: FC = () => {
|
||||
|
||||
const { data } = useGetLanding()
|
||||
|
||||
const incredibleOffers = data?.results?.incredibleOffers || []
|
||||
|
||||
if (!incredibleOffers.length) {
|
||||
return null
|
||||
}
|
||||
|
||||
return (
|
||||
<div className='bg-[#F2F2F2] rounded-xl sm:rounded-2xl flex flex-col sm:flex-row py-4 sm:py-6'>
|
||||
<div className='px-4 sm:px-6 w-full sm:min-w-[140px] sm:max-w-[180px] flex flex-col justify-center items-center sm:items-start'>
|
||||
@@ -41,18 +51,11 @@ const HotOffer: FC = () => {
|
||||
},
|
||||
}}
|
||||
>
|
||||
<SwiperSlide className='!w-auto'>
|
||||
<ProductCard />
|
||||
</SwiperSlide>
|
||||
<SwiperSlide className='!w-auto'>
|
||||
<ProductCard />
|
||||
</SwiperSlide>
|
||||
<SwiperSlide className='!w-auto'>
|
||||
<ProductCard />
|
||||
</SwiperSlide>
|
||||
<SwiperSlide className='!w-auto'>
|
||||
<ProductCard />
|
||||
</SwiperSlide>
|
||||
{incredibleOffers.map((product) => (
|
||||
<SwiperSlide key={product._id} className='!w-auto'>
|
||||
<ProductCard item={product} />
|
||||
</SwiperSlide>
|
||||
))}
|
||||
</Swiper>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user