summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorit-fixcomart <it@fixcomart.co.id>2024-07-17 14:09:51 +0700
committerit-fixcomart <it@fixcomart.co.id>2024-07-17 14:09:51 +0700
commita42272ae50a5e8661db5ae534f08f475efb05665 (patch)
tree3882ca64775dc8d46c0ac539e87c3d5a67b0d91e
parent60060b517651e1122a638a3f592017879a0e9e63 (diff)
<iman> update all promotion
-rw-r--r--src-migrate/modules/promo/components/FlashSale.tsx1
-rw-r--r--src-migrate/modules/promo/components/Hero.tsx24
-rw-r--r--src/core/components/elements/Navbar/NavbarDesktop.jsx3
-rw-r--r--src/core/components/elements/Navbar/style/NavbarDesktop.module.css14
4 files changed, 27 insertions, 15 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>
diff --git a/src/core/components/elements/Navbar/NavbarDesktop.jsx b/src/core/components/elements/Navbar/NavbarDesktop.jsx
index 66dc730c..3fd6dfc3 100644
--- a/src/core/components/elements/Navbar/NavbarDesktop.jsx
+++ b/src/core/components/elements/Navbar/NavbarDesktop.jsx
@@ -19,6 +19,7 @@ import DesktopView from '../../views/DesktopView';
import Link from '../Link/Link';
import NavbarUserDropdown from './NavbarUserDropdown';
import NextImage from 'next/image';
+import style from "./style/NavbarDesktop.module.css";
const Search = dynamic(() => import('./Search'), { ssr: false });
const TopBanner = dynamic(() => import('./TopBanner'), { ssr: false });
@@ -179,7 +180,7 @@ const NavbarDesktop = () => {
rel="noreferrer"
>
<p className="group-hover:scale-105 group-hover:text-red-500 transition-transform duration-200">Semua Promo</p>
- <p className="rounded bg-red-500 font-bold text-white text-[10px] w-auto inline-block p-[2px] rotate-12 -translate-y-2 group-hover:scale-105 transition-transform duration-200">NEW!</p>
+ <p className={`rounded bg-red-500 font-bold text-white text-[10px] w-auto inline-block p-[2px] group-hover:scale-105 transition-transform duration-200 ${style.blink}`}>NEW!</p>
</Link>
<Link
diff --git a/src/core/components/elements/Navbar/style/NavbarDesktop.module.css b/src/core/components/elements/Navbar/style/NavbarDesktop.module.css
new file mode 100644
index 00000000..9cddb127
--- /dev/null
+++ b/src/core/components/elements/Navbar/style/NavbarDesktop.module.css
@@ -0,0 +1,14 @@
+/* navbarDesktop.module.css */
+@keyframes blink {
+ 0%, 100% {
+ opacity: 1;
+ }
+ 50% {
+ opacity: 0;
+ }
+}
+
+.blink {
+ animation: blink 0.8s infinite;
+}
+