fixing banner landing
This commit is contained in:
parent
2c18d422d5
commit
0873cef3ce
|
|
@ -218,8 +218,23 @@ const HeroModal = ({
|
|||
};
|
||||
}, []);
|
||||
|
||||
// const initFetch = async () => {
|
||||
// const response = await listPopUp(
|
||||
// group === "mabes"
|
||||
// ? ""
|
||||
// : group === "polda" && poldaName
|
||||
// ? poldaName
|
||||
// : group === "satker" && satkerName
|
||||
// ? "satker-" + satkerName
|
||||
// : "",
|
||||
// locale == "en"
|
||||
// );
|
||||
// const interstitial = response?.data?.data || [];
|
||||
// setHeroData(interstitial);
|
||||
// };
|
||||
|
||||
const initFetch = async () => {
|
||||
const response = await listPopUp(
|
||||
const response = await listStaticBanner(
|
||||
group === "mabes"
|
||||
? ""
|
||||
: group === "polda" && poldaName
|
||||
|
|
@ -227,10 +242,17 @@ const HeroModal = ({
|
|||
: group === "satker" && satkerName
|
||||
? "satker-" + satkerName
|
||||
: "",
|
||||
locale == "en"
|
||||
locale === "en"
|
||||
);
|
||||
const interstitial = response?.data?.data || [];
|
||||
setHeroData(interstitial);
|
||||
|
||||
const banners = response?.data?.data || [];
|
||||
|
||||
const enrichedData = banners.map((item: any) => ({
|
||||
...item,
|
||||
fileTypeId: item?.fileType?.id ?? null,
|
||||
}));
|
||||
|
||||
setHeroData(enrichedData);
|
||||
};
|
||||
|
||||
const handleClickOutside = (event: React.MouseEvent<HTMLDivElement>) => {
|
||||
|
|
|
|||
|
|
@ -2,7 +2,11 @@ import { formatDateToIndonesian, shimmer, toBase64 } from "@/utils/globals";
|
|||
import React, { useEffect, useRef, useState } from "react";
|
||||
import "swiper/css/bundle";
|
||||
import "swiper/css/navigation";
|
||||
import { getHeroData, listPopUp, listStaticBanner } from "@/service/landing/landing";
|
||||
import {
|
||||
getHeroData,
|
||||
listPopUp,
|
||||
listStaticBanner,
|
||||
} from "@/service/landing/landing";
|
||||
import Link from "next/link";
|
||||
import { useParams, usePathname, useRouter } from "next/navigation";
|
||||
import {
|
||||
|
|
@ -207,8 +211,23 @@ const HeroModal = ({
|
|||
};
|
||||
}, []);
|
||||
|
||||
// const initFetch = async () => {
|
||||
// const response = await listPopUp(
|
||||
// group === "mabes"
|
||||
// ? ""
|
||||
// : group === "polda" && poldaName
|
||||
// ? poldaName
|
||||
// : group === "satker" && satkerName
|
||||
// ? "satker-" + satkerName
|
||||
// : "",
|
||||
// locale == "en"
|
||||
// );
|
||||
// const interstitial = response?.data?.data || [];
|
||||
// setHeroData(interstitial);
|
||||
// };
|
||||
|
||||
const initFetch = async () => {
|
||||
const response = await listPopUp(
|
||||
const response = await listStaticBanner(
|
||||
group === "mabes"
|
||||
? ""
|
||||
: group === "polda" && poldaName
|
||||
|
|
@ -216,10 +235,17 @@ const HeroModal = ({
|
|||
: group === "satker" && satkerName
|
||||
? "satker-" + satkerName
|
||||
: "",
|
||||
locale == "en"
|
||||
locale === "en"
|
||||
);
|
||||
const interstitial = response?.data?.data || [];
|
||||
setHeroData(interstitial);
|
||||
|
||||
const banners = response?.data?.data || [];
|
||||
|
||||
const enrichedData = banners.map((item: any) => ({
|
||||
...item,
|
||||
fileTypeId: item?.fileType?.id ?? null,
|
||||
}));
|
||||
|
||||
setHeroData(enrichedData);
|
||||
};
|
||||
|
||||
const handleClickOutside = (event: React.MouseEvent<HTMLDivElement>) => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue