temporary jumbotron
This commit is contained in:
parent
3a9b625804
commit
e48ad4e5f9
|
|
@ -104,7 +104,6 @@ export default function AdvertisePage() {
|
|||
}
|
||||
|
||||
close();
|
||||
setRefresh(!refresh);
|
||||
MySwal.fire({
|
||||
title: "Sukses",
|
||||
icon: "success",
|
||||
|
|
@ -112,6 +111,7 @@ export default function AdvertisePage() {
|
|||
confirmButtonText: "OK",
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
setRefresh(!refresh);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
|
|
|||
|
|
@ -53,6 +53,7 @@ interface Jumbotron {
|
|||
title: string;
|
||||
description: string;
|
||||
redirectLink: string;
|
||||
contentFileUrl: string;
|
||||
}
|
||||
|
||||
export default function BannerHumasNew() {
|
||||
|
|
@ -92,7 +93,7 @@ export default function BannerHumasNew() {
|
|||
}, []);
|
||||
|
||||
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);
|
||||
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"
|
||||
style={{ transform: `translateX(-${currentIndex * 100}%)` }}
|
||||
>
|
||||
{jumbotronList?.map((img, index) => (
|
||||
<Link
|
||||
href={img?.redirectLink}
|
||||
key={img?.id}
|
||||
className="w-full shrink-0"
|
||||
>
|
||||
{jumbotronList?.length > 0 ? (
|
||||
jumbotronList?.map((img, index) => (
|
||||
<Link
|
||||
href={img?.redirectLink}
|
||||
key={img?.id}
|
||||
className="w-full shrink-0"
|
||||
>
|
||||
<Image
|
||||
// src={images[index % 4]}
|
||||
src={
|
||||
img?.contentFileUrl == ""
|
||||
? "/no-image.jpg"
|
||||
: img?.contentFileUrl
|
||||
}
|
||||
unoptimized
|
||||
alt={`humasbanner-${index}`}
|
||||
width={1960}
|
||||
height={1080}
|
||||
className="w-screen h-[45vh] lg:h-[93vh] object-cover object-center opacity-[25] dark:opacity-70 rounded-none"
|
||||
/>
|
||||
</Link>
|
||||
))
|
||||
) : (
|
||||
<Link href="/" key="home" className="w-full shrink-0">
|
||||
<Image
|
||||
src={images[index % 4]}
|
||||
alt={`humasbanner-${index}`}
|
||||
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 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%]">
|
||||
|
|
|
|||
Loading…
Reference in New Issue