From b85cc30b2891faac3fd08191e03f80ccd42cefa0 Mon Sep 17 00:00:00 2001 From: EvanLin3141 Date: Wed, 5 Mar 2025 16:35:57 +0000 Subject: [PATCH] FIX: Thumbnails in HomePAGE --- frontend/src/pages/HomePage.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/frontend/src/pages/HomePage.tsx b/frontend/src/pages/HomePage.tsx index f51b5bf..3f0857a 100644 --- a/frontend/src/pages/HomePage.tsx +++ b/frontend/src/pages/HomePage.tsx @@ -6,8 +6,10 @@ import Button from "../components/Input/Button"; import DynamicPageContent from "../components/Layout/DynamicPageContent"; import LoadingScreen from "../components/Layout/LoadingScreen"; import Footer from "../components/Layout/Footer"; +import { useAuth } from "../context/AuthContext"; const HomePage: React.FC = () => { + const { username } = useAuth(); const { streams, isLoading: isLoadingStreams } = useStreams(); const { categories, isLoading: isLoadingCategories } = useCategories(); const { vods, isLoading: isLoadingVods } = useVods(); @@ -19,6 +21,11 @@ const HomePage: React.FC = () => { if (isLoadingStreams || isLoadingCategories || isLoadingVods) return Loading Content...; + const thumbnails = vods.map((vod) => ({ + ...vod, + thumbnail: `/vods/${vod.username}/${vod.vod_id}.png`, + })); + return ( {/* Streams Section */} @@ -55,7 +62,7 @@ const HomePage: React.FC = () => { type="vod" title="Recent VODs" description="Watch the latest recorded streams!" - items={vods} + items={thumbnails} wrap={false} onItemClick={handleVodClick} extraClasses="bg-black/50"