increable offers + fix bugs
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user