summaryrefslogtreecommitdiff
path: root/src-migrate/modules
diff options
context:
space:
mode:
Diffstat (limited to 'src-migrate/modules')
-rw-r--r--src-migrate/modules/promo/components/FlashSale.tsx1
-rw-r--r--src-migrate/modules/promo/components/Hero.tsx24
2 files changed, 11 insertions, 14 deletions
diff --git a/src-migrate/modules/promo/components/FlashSale.tsx b/src-migrate/modules/promo/components/FlashSale.tsx
index 05bf1e11..c0259396 100644
--- a/src-migrate/modules/promo/components/FlashSale.tsx
+++ b/src-migrate/modules/promo/components/FlashSale.tsx
@@ -12,7 +12,6 @@ const FlashSale = dynamic(
const FlashSalePromo = ()=> {
return(
<>
- <h1 className='h-4'></h1>
<FlashSale/>
</>
)
diff --git a/src-migrate/modules/promo/components/Hero.tsx b/src-migrate/modules/promo/components/Hero.tsx
index b6e27270..7eb84270 100644
--- a/src-migrate/modules/promo/components/Hero.tsx
+++ b/src-migrate/modules/promo/components/Hero.tsx
@@ -10,11 +10,11 @@ import 'swiper/css/pagination';
import { Navigation, Pagination, Autoplay } from 'swiper';
import MobileView from '../../../../src/core/components/views/MobileView';
import DesktopView from '@/core/components/views/DesktopView';
-import { getPromotionProgramSolr } from '~/services/promotionProgram';
+import {bannerApi} from '../../../../src/api/bannerApi'
interface IPromotionProgram {
- banner_s: string;
- name_s: string;
+ image: string ;
+ name: string;
}
const swiperBanner: SwiperProps = {
@@ -41,20 +41,18 @@ const swiperBannerMob = {
};
const Hero = () => {
- const bannerQuery = useQuery({
- queryKey: ['banner.all-promo'],
- queryFn: getPromotionProgramSolr,
- });
+ const heroBanner = useQuery('heroBannerSecondary', bannerApi({ type: 'banner-promotion' }))
const banners: IPromotionProgram[] = useMemo(
- () => bannerQuery.data?.response?.docs || [],
- [bannerQuery.data]
+ () => heroBanner?.data || [],
+ [heroBanner.data]
);
const swiperBannerMobile = {
...swiperBannerMob,
pagination: { dynamicBullets: false, clickable: true },
};
+
return (
<>
@@ -71,8 +69,8 @@ const Hero = () => {
{banners.map((banner, index) => (
<SwiperSlide key={index}>
<Image
- src={banner.banner_s}
- alt={banner.name_s}
+ src={banner.image}
+ alt={banner.name}
width={666}
height={450}
quality={100}
@@ -91,8 +89,8 @@ const Hero = () => {
width={439}
height={150}
quality={100}
- src={banner.banner_s}
- alt={banner.name_s}
+ src={banner.image}
+ alt={banner.name}
className='w-full h-full object-cover object-center rounded-2xl'
/>
</SwiperSlide>