Improve video display by hiding numbers on hover
Update the `CategoryRow` component to hide the "Top 10" number overlay when the mouse leaves the video or when hovering over a different video, and to display the number only when a specific video is not selected. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 074b0e4c-6171-43bd-aa98-f9e04623ca14 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/8cc42625-c1f5-4e43-99bd-77f2c4dedee2/074b0e4c-6171-43bd-aa98-f9e04623ca14/7j5FE92
This commit is contained in:
parent
74a94cacac
commit
77055dec61
@ -186,7 +186,10 @@ function CategoryRow({ category, onVideoClick }: CategoryRowProps) {
|
|||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="relative group mb-8">
|
<div
|
||||||
|
className="relative group mb-8"
|
||||||
|
onMouseLeave={() => setClickedVideoId(null)}
|
||||||
|
>
|
||||||
<h2 className="text-2xl font-bold text-bunny-light mb-6 px-4">
|
<h2 className="text-2xl font-bold text-bunny-light mb-6 px-4">
|
||||||
{category.title}
|
{category.title}
|
||||||
</h2>
|
</h2>
|
||||||
@ -224,12 +227,7 @@ function CategoryRow({ category, onVideoClick }: CategoryRowProps) {
|
|||||||
<div
|
<div
|
||||||
key={video.id}
|
key={video.id}
|
||||||
className="flex-shrink-0 w-[calc(50vw-2px)] sm:w-[calc(33.33vw-2px)] md:w-[calc(25vw-2px)] lg:w-[calc(20vw-2px)] relative group"
|
className="flex-shrink-0 w-[calc(50vw-2px)] sm:w-[calc(33.33vw-2px)] md:w-[calc(25vw-2px)] lg:w-[calc(20vw-2px)] relative group"
|
||||||
onMouseEnter={() => {
|
onMouseEnter={() => setClickedVideoId(video.id)}
|
||||||
// Reset clicked state when hovering over any video
|
|
||||||
if (clickedVideoId) {
|
|
||||||
setClickedVideoId(null);
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
{/* Top 10 Number overlay for first category */}
|
{/* Top 10 Number overlay for first category */}
|
||||||
{category.title.includes("Top 10") && index < 10 && clickedVideoId !== video.id && (
|
{category.title.includes("Top 10") && index < 10 && clickedVideoId !== video.id && (
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user