fix(hackathon): add missing image loading handlers on team page

- 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 <noreply@anthropic.com>
This commit is contained in:
Maulana Sodiqin
2025-11-26 16:50:54 +07:00
co-authored by Claude
parent 19bd44a7ca
commit 63643cc286
@@ -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 || ''
);