From 92af4a4f6da451ab1e9e184db9445f4b2a674bcd Mon Sep 17 00:00:00 2001 From: hanif salafi Date: Mon, 7 Jul 2025 02:20:22 +0700 Subject: [PATCH] feat: update hero modal and category --- components/landing-page/content-category.tsx | 2 +- components/landing-page/hero-new.tsx | 27 +++++++------------ .../content-category-kaltara.tsx | 2 +- 3 files changed, 11 insertions(+), 20 deletions(-) diff --git a/components/landing-page/content-category.tsx b/components/landing-page/content-category.tsx index 96a045a2..b595ad88 100644 --- a/components/landing-page/content-category.tsx +++ b/components/landing-page/content-category.tsx @@ -82,7 +82,7 @@ const ContentCategory = (props: { group?: string; type: string }) => { alt="category" width={2560} height={1440} - src={category?.thumbnailLink} + src={category?.smallThumbnailLink} className="w-full lg:h-[300px] h-40 object-cover group-hover:scale-110 transition-transform duration-300" /> diff --git a/components/landing-page/hero-new.tsx b/components/landing-page/hero-new.tsx index 375dcd96..1a54de51 100644 --- a/components/landing-page/hero-new.tsx +++ b/components/landing-page/hero-new.tsx @@ -80,24 +80,6 @@ const HeroModal = ({ : ""; useEffect(() => { - async function fetchCategories() { - const url = "https://netidhub.com/api/csrf"; - - try { - const response = await fetch(url); - - if (!response.ok) { - throw new Error(`HTTP error! status: ${response.status}`); - } - - const data = await response.json(); - return data; - } catch (error) { - console.error("Fetch error: ", error); - } - } - - fetchCategories(); initFetch(); }, []); @@ -330,6 +312,15 @@ const HeroNew = (props: { group?: string }) => { initFetch(); }, []); + // Show hero modal after 20 seconds when website is fully loaded + useEffect(() => { + const timer = setTimeout(() => { + setShowModal(true); + }, 30000); // 30 seconds + + return () => clearTimeout(timer); + }, []); + useEffect(() => { async function fetchCategories() { const url = "https://netidhub.com/api/csrf"; diff --git a/components/landing-page/landing-polda-kaltara/content-category-kaltara.tsx b/components/landing-page/landing-polda-kaltara/content-category-kaltara.tsx index bb8005a8..acfd9bef 100644 --- a/components/landing-page/landing-polda-kaltara/content-category-kaltara.tsx +++ b/components/landing-page/landing-polda-kaltara/content-category-kaltara.tsx @@ -109,7 +109,7 @@ const ContentCategoryKaltara = (props: { group?: string; type: string }) => { alt="category" width={2560} height={1440} - src={category?.thumbnailLink} + src={category?.smallThumbnailLink} className="w-full lg:h-[250px] h-40 object-cover group-hover:scale-110 transition-transform duration-300" />