summaryrefslogtreecommitdiff
path: root/src-migrate/modules/promo/components/Hero.tsx
diff options
context:
space:
mode:
authorit-fixcomart <it@fixcomart.co.id>2024-06-21 10:52:28 +0700
committerit-fixcomart <it@fixcomart.co.id>2024-06-21 10:52:28 +0700
commit208b234320b6c42491a4e87a1c3db3abab9c1715 (patch)
tree338b47199daec420f04c977c5bbbc2028741e443 /src-migrate/modules/promo/components/Hero.tsx
parent040657403a01205b22e1028d8ebea971f5df9ac5 (diff)
<iman> update all-promotion
Diffstat (limited to 'src-migrate/modules/promo/components/Hero.tsx')
-rw-r--r--src-migrate/modules/promo/components/Hero.tsx14
1 files changed, 9 insertions, 5 deletions
diff --git a/src-migrate/modules/promo/components/Hero.tsx b/src-migrate/modules/promo/components/Hero.tsx
index 5470b93b..d8bb0be4 100644
--- a/src-migrate/modules/promo/components/Hero.tsx
+++ b/src-migrate/modules/promo/components/Hero.tsx
@@ -3,26 +3,30 @@ import 'swiper/css';
import Image from 'next/image';
import { useEffect, useMemo } from 'react';
import { useQuery } from 'react-query';
-import { Swiper, SwiperProps, SwiperSlide } from 'swiper/react';
+import { Swiper, SwiperProps, SwiperSlide } from 'swiper/react';
import { getBanner } from '~/services/banner';
import style from '../styles/hero.module.css';
+import 'swiper/css/navigation';
+import { Navigation, Pagination } from 'swiper';
const swiperBanner: SwiperProps = {
+ modules:[Navigation, Pagination],
autoplay: {
delay: 6000,
disableOnInteraction: false
},
- loop: false,
+ loop: true,
className: 'h-[400px] w-full',
slidesPerView: 1,
- spaceBetween: 10
+ spaceBetween: 10,
+ navigation:true,
}
const Hero = () => {
const bannerQuery = useQuery({
queryKey: ['banner.all-promo'],
- queryFn: () => getBanner({ type: 'all-promo' })
+ queryFn: () => getBanner({ type: 'banner-promotion' })
})
const banners = useMemo(() => bannerQuery.data || [], [bannerQuery.data]);
@@ -47,7 +51,7 @@ const Hero = () => {
{banners.map((banner, index) => (
<SwiperSlide key={index}>
<Image
- src='https://erp.indoteknik.com/api/image/x_banner.banner/x_banner_image/363'
+ src={banner.image}
alt={banner.name}
width={666}
height={450}