From 63643cc2860fc5202323f6da3622b29f5de73a74 Mon Sep 17 00:00:00 2001 From: Maulana Sodiqin Date: Wed, 26 Nov 2025 16:50:54 +0700 Subject: [PATCH] fix(hackathon): add missing image loading handlers on team page MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add totalImagesToLoad, handleImageLoad, handleImageError - Disable image loading overlay to prevent blocking UI - Fix ReferenceError: totalImagesToLoad is not defined 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .../hackathon/src/app/teams/[teamId]/page.tsx | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/apps/hackathon/src/app/teams/[teamId]/page.tsx b/apps/hackathon/src/app/teams/[teamId]/page.tsx index a123a6e..2e09f8d 100644 --- a/apps/hackathon/src/app/teams/[teamId]/page.tsx +++ b/apps/hackathon/src/app/teams/[teamId]/page.tsx @@ -55,6 +55,29 @@ const TeamDashboardPage: FC = (): ReactElement => { const [imagesLoaded, setImagesLoaded] = useState(false); const [imageLoadCount, setImageLoadCount] = useState(0); + // Calculate total images to load (banner + logo + member avatars) + const totalImagesToLoad = 0; // Simplified - disable image loading overlay + + const handleImageLoad = () => { + setImageLoadCount((prev) => { + const newCount = prev + 1; + if (newCount >= totalImagesToLoad) { + setImagesLoaded(true); + } + return newCount; + }); + }; + + const handleImageError = () => { + // Treat error as loaded to not block the UI + handleImageLoad(); + }; + + // Set images as loaded immediately since we disabled the loading overlay + useEffect(() => { + setImagesLoaded(true); + }, []); + const { data: teamData, isLoading: isLoadingTeam } = useTeamById( teamId || '' );