REFACTOR: Add extraClasses prop to ListItem;

REFACTOR: Remove unused `Navbar` import in `UserPage`;
This commit is contained in:
Chris-1010
2025-02-19 23:16:15 +00:00
parent bcfe57eeae
commit 8c545716f5
3 changed files with 6 additions and 3 deletions

View File

@@ -9,6 +9,7 @@ export interface ListItemProps {
viewers: number; viewers: number;
thumbnail?: string; thumbnail?: string;
onItemClick?: () => void; onItemClick?: () => void;
extraClasses?: string;
} }
const ListItem: React.FC<ListItemProps> = ({ const ListItem: React.FC<ListItemProps> = ({
@@ -19,12 +20,12 @@ const ListItem: React.FC<ListItemProps> = ({
viewers, viewers,
thumbnail, thumbnail,
onItemClick, onItemClick,
extraClasses = "",
}) => { }) => {
return ( return (
<div className="p-4"> <div className="p-4">
<div <div
className="min-w-[20vw] overflow-hidden flex-shrink-0 flex flex-col bg-purple-900 rounded-lg className={`${extraClasses} overflow-hidden flex-shrink-0 flex flex-col bg-purple-900 rounded-lg cursor-pointer mx-auto hover:bg-pink-700 hover:scale-105 transition-all`}
cursor-pointer hover:bg-pink-700 hover:scale-105 transition-all"
onClick={onItemClick} onClick={onItemClick}
> >
<div className="relative w-full pt-[56.25%] overflow-hidden rounded-t-lg"> <div className="relative w-full pt-[56.25%] overflow-hidden rounded-t-lg">

View File

@@ -14,6 +14,7 @@ interface ListRowProps {
wrap: boolean; wrap: boolean;
onClick: (itemName: string) => void; onClick: (itemName: string) => void;
extraClasses?: string; extraClasses?: string;
itemExtraClasses?: string;
children?: React.ReactNode; children?: React.ReactNode;
} }
@@ -25,6 +26,7 @@ const ListRow: React.FC<ListRowProps> = ({
wrap, wrap,
onClick, onClick,
extraClasses = "", extraClasses = "",
itemExtraClasses = "",
children, children,
}) => { }) => {
const slider = useRef<HTMLDivElement>(null); const slider = useRef<HTMLDivElement>(null);
@@ -91,6 +93,7 @@ const ListRow: React.FC<ListRowProps> = ({
? onClick?.(item.streamer) ? onClick?.(item.streamer)
: onClick?.(item.title) : onClick?.(item.title)
} }
extraClasses={`${itemExtraClasses} min-w-[25vw]`}
/> />
))} ))}
</div> </div>

View File

@@ -1,5 +1,4 @@
import React, { useState, useEffect } from "react"; import React, { useState, useEffect } from "react";
import Navbar from "../components/Navigation/Navbar";
import AuthModal from "../components/Auth/AuthModal"; import AuthModal from "../components/Auth/AuthModal";
import { useAuthModal } from "../hooks/useAuthModal"; import { useAuthModal } from "../hooks/useAuthModal";
import { useAuth } from "../context/AuthContext"; import { useAuth } from "../context/AuthContext";