feat: update hero modal and category

This commit is contained in:
hanif salafi 2025-07-07 02:20:22 +07:00
parent 1bb6363a69
commit 92af4a4f6d
3 changed files with 11 additions and 20 deletions

View File

@ -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"
/>

View File

@ -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";

View File

@ -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"
/>