FIX: Thumbnails in HomePAGE
This commit is contained in:
@@ -6,8 +6,10 @@ import Button from "../components/Input/Button";
|
|||||||
import DynamicPageContent from "../components/Layout/DynamicPageContent";
|
import DynamicPageContent from "../components/Layout/DynamicPageContent";
|
||||||
import LoadingScreen from "../components/Layout/LoadingScreen";
|
import LoadingScreen from "../components/Layout/LoadingScreen";
|
||||||
import Footer from "../components/Layout/Footer";
|
import Footer from "../components/Layout/Footer";
|
||||||
|
import { useAuth } from "../context/AuthContext";
|
||||||
|
|
||||||
const HomePage: React.FC = () => {
|
const HomePage: React.FC = () => {
|
||||||
|
const { username } = useAuth();
|
||||||
const { streams, isLoading: isLoadingStreams } = useStreams();
|
const { streams, isLoading: isLoadingStreams } = useStreams();
|
||||||
const { categories, isLoading: isLoadingCategories } = useCategories();
|
const { categories, isLoading: isLoadingCategories } = useCategories();
|
||||||
const { vods, isLoading: isLoadingVods } = useVods();
|
const { vods, isLoading: isLoadingVods } = useVods();
|
||||||
@@ -19,6 +21,11 @@ const HomePage: React.FC = () => {
|
|||||||
|
|
||||||
if (isLoadingStreams || isLoadingCategories || isLoadingVods) return <LoadingScreen>Loading Content...</LoadingScreen>;
|
if (isLoadingStreams || isLoadingCategories || isLoadingVods) return <LoadingScreen>Loading Content...</LoadingScreen>;
|
||||||
|
|
||||||
|
const thumbnails = vods.map((vod) => ({
|
||||||
|
...vod,
|
||||||
|
thumbnail: `/vods/${vod.username}/${vod.vod_id}.png`,
|
||||||
|
}));
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<DynamicPageContent navbarVariant="home" className="relative min-h-screen animate-moving_bg" contentClassName="pb-[12vh]">
|
<DynamicPageContent navbarVariant="home" className="relative min-h-screen animate-moving_bg" contentClassName="pb-[12vh]">
|
||||||
{/* Streams Section */}
|
{/* Streams Section */}
|
||||||
@@ -55,7 +62,7 @@ const HomePage: React.FC = () => {
|
|||||||
type="vod"
|
type="vod"
|
||||||
title="Recent VODs"
|
title="Recent VODs"
|
||||||
description="Watch the latest recorded streams!"
|
description="Watch the latest recorded streams!"
|
||||||
items={vods}
|
items={thumbnails}
|
||||||
wrap={false}
|
wrap={false}
|
||||||
onItemClick={handleVodClick}
|
onItemClick={handleVodClick}
|
||||||
extraClasses="bg-black/50"
|
extraClasses="bg-black/50"
|
||||||
|
|||||||
Reference in New Issue
Block a user