From ec3b9616106784958104c6ef2b21738adc59bb63 Mon Sep 17 00:00:00 2001 From: Ivan Evans <74743263+Pasithea0@users.noreply.github.com> Date: Wed, 25 Sep 2024 13:17:48 -0600 Subject: [PATCH] Make renderButtons a dropdown --- src/utils/discoverContent.tsx | 101 +++++++++++++++++++++------------- 1 file changed, 63 insertions(+), 38 deletions(-) diff --git a/src/utils/discoverContent.tsx b/src/utils/discoverContent.tsx index e6cc7121..6f83835a 100644 --- a/src/utils/discoverContent.tsx +++ b/src/utils/discoverContent.tsx @@ -160,6 +160,16 @@ export function DiscoverContent() { const [editorPicksData, setEditorPicksData] = useState([]); + // New state to track selected category (movies or TV shows) + const [selectedCategory, setSelectedCategory] = useState("movies"); + + // Handle category change + const handleCategoryChange = ( + event: React.ChangeEvent, + ) => { + setSelectedCategory(event.target.value); + }; + useEffect(() => { // Function to shuffle array const shuffleArray = (array: any[]) => { @@ -877,49 +887,64 @@ export function DiscoverContent() { )}
-

Movies:

-
- {!isMobile &&
{renderScrollButton("movies", "left")}
} - -

TV Shows:

-
- {!isMobile && ( -
{renderScrollButton("tvshows", "left")}
- )} -