temporary jumbotron
This commit is contained in:
parent
3a9b625804
commit
e48ad4e5f9
|
|
@ -104,7 +104,6 @@ export default function AdvertisePage() {
|
||||||
}
|
}
|
||||||
|
|
||||||
close();
|
close();
|
||||||
setRefresh(!refresh);
|
|
||||||
MySwal.fire({
|
MySwal.fire({
|
||||||
title: "Sukses",
|
title: "Sukses",
|
||||||
icon: "success",
|
icon: "success",
|
||||||
|
|
@ -112,6 +111,7 @@ export default function AdvertisePage() {
|
||||||
confirmButtonText: "OK",
|
confirmButtonText: "OK",
|
||||||
}).then((result) => {
|
}).then((result) => {
|
||||||
if (result.isConfirmed) {
|
if (result.isConfirmed) {
|
||||||
|
setRefresh(!refresh);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -53,6 +53,7 @@ interface Jumbotron {
|
||||||
title: string;
|
title: string;
|
||||||
description: string;
|
description: string;
|
||||||
redirectLink: string;
|
redirectLink: string;
|
||||||
|
contentFileUrl: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function BannerHumasNew() {
|
export default function BannerHumasNew() {
|
||||||
|
|
@ -92,7 +93,7 @@ export default function BannerHumasNew() {
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const initFetch = async () => {
|
const initFetch = async () => {
|
||||||
const req = { page: 1, limit: 5, placement: "jumbotron" };
|
const req = { page: 1, limit: 5, placement: "jumbotron", isPublish: true };
|
||||||
const res = await getAdvertise(req);
|
const res = await getAdvertise(req);
|
||||||
setJumbotronList(res?.data?.data);
|
setJumbotronList(res?.data?.data);
|
||||||
};
|
};
|
||||||
|
|
@ -224,21 +225,39 @@ export default function BannerHumasNew() {
|
||||||
className="flex w-full h-[45vh] lg:h-[93vh] transition-transform duration-700 ease-in-out"
|
className="flex w-full h-[45vh] lg:h-[93vh] transition-transform duration-700 ease-in-out"
|
||||||
style={{ transform: `translateX(-${currentIndex * 100}%)` }}
|
style={{ transform: `translateX(-${currentIndex * 100}%)` }}
|
||||||
>
|
>
|
||||||
{jumbotronList?.map((img, index) => (
|
{jumbotronList?.length > 0 ? (
|
||||||
|
jumbotronList?.map((img, index) => (
|
||||||
<Link
|
<Link
|
||||||
href={img?.redirectLink}
|
href={img?.redirectLink}
|
||||||
key={img?.id}
|
key={img?.id}
|
||||||
className="w-full shrink-0"
|
className="w-full shrink-0"
|
||||||
>
|
>
|
||||||
<Image
|
<Image
|
||||||
src={images[index % 4]}
|
// src={images[index % 4]}
|
||||||
|
src={
|
||||||
|
img?.contentFileUrl == ""
|
||||||
|
? "/no-image.jpg"
|
||||||
|
: img?.contentFileUrl
|
||||||
|
}
|
||||||
|
unoptimized
|
||||||
alt={`humasbanner-${index}`}
|
alt={`humasbanner-${index}`}
|
||||||
width={1960}
|
width={1960}
|
||||||
height={1080}
|
height={1080}
|
||||||
className="w-screen h-[45vh] lg:h-[93vh] object-cover object-center opacity-[25] dark:opacity-70 rounded-none"
|
className="w-screen h-[45vh] lg:h-[93vh] object-cover object-center opacity-[25] dark:opacity-70 rounded-none"
|
||||||
/>
|
/>
|
||||||
</Link>
|
</Link>
|
||||||
))}
|
))
|
||||||
|
) : (
|
||||||
|
<Link href="/" key="home" className="w-full shrink-0">
|
||||||
|
<Image
|
||||||
|
src={images[0]}
|
||||||
|
alt={`humasbanner-1`}
|
||||||
|
width={1960}
|
||||||
|
height={1080}
|
||||||
|
className="w-screen h-[45vh] lg:h-[93vh] object-cover object-center opacity-[25] dark:opacity-70 rounded-none"
|
||||||
|
/>
|
||||||
|
</Link>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div className="absolute inset-0 bg-black bg-opacity-40 pointer-events-none" />
|
<div className="absolute inset-0 bg-black bg-opacity-40 pointer-events-none" />
|
||||||
<div className="absolute z-50 lg:mt-[50px] top-48 lg:top-1/3 left-1/2 transform -translate-x-1/2 -translate-y-1/2 text-center w-full lg:w-[75%]">
|
<div className="absolute z-50 lg:mt-[50px] top-48 lg:top-1/3 left-1/2 transform -translate-x-1/2 -translate-y-1/2 text-center w-full lg:w-[75%]">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue