increable offers + fix bugs

This commit is contained in:
hamid zarghami
2025-10-16 11:23:38 +03:30
parent 0a3b819a7e
commit 225329f342
13 changed files with 291 additions and 163 deletions
+20 -11
View File
@@ -3,6 +3,7 @@ import { FC, useState, useEffect } from 'react'
import { Swiper, SwiperSlide } from 'swiper/react';
import { Pagination } from 'swiper/modules';
import Image from 'next/image';
import Link from 'next/link';
import { useGetLanding } from '../hooks/useHomeData';
const Carousel: FC = () => {
@@ -32,17 +33,25 @@ const Carousel: FC = () => {
<Swiper pagination={true} modules={[Pagination]} className="mySwiper pb-5" style={{ zIndex: 0, position: 'relative' }}>
{sliders.map((slider) => (
<SwiperSlide key={slider._id}>
<div
className='h-[200px] sm:h-[300px] md:h-[400px] relative cursor-pointer'
onClick={() => slider.linkUrl && window.open(slider.linkUrl, '_blank')}
>
<Image
src={slider.imageUrl}
alt={slider.altText}
fill
className="object-cover rounded-lg"
/>
</div>
{slider.linkUrl ? (
<Link href={slider.linkUrl} className='block h-[200px] sm:h-[300px] md:h-[400px] relative'>
<Image
src={slider.imageUrl}
alt={slider.altText}
fill
className="object-cover rounded-lg"
/>
</Link>
) : (
<div className='h-[200px] sm:h-[300px] md:h-[400px] relative'>
<Image
src={slider.imageUrl}
alt={slider.altText}
fill
className="object-cover rounded-lg"
/>
</div>
)}
</SwiperSlide>
))}
</Swiper>