From a8cbfc0dbef2281db6b06df138e8bc356854e119 Mon Sep 17 00:00:00 2001 From: Ivan Evans <74743263+Pasithea0@users.noreply.github.com> Date: Wed, 25 Sep 2024 15:31:03 -0600 Subject: [PATCH] Adjust buttons and move popular sections --- src/utils/discoverContent.tsx | 298 +++++++++++++++++++++++++--------- 1 file changed, 224 insertions(+), 74 deletions(-) diff --git a/src/utils/discoverContent.tsx b/src/utils/discoverContent.tsx index 6f83835a..a8ed0b87 100644 --- a/src/utils/discoverContent.tsx +++ b/src/utils/discoverContent.tsx @@ -117,26 +117,23 @@ export function DiscoverContent() { }); const movieProviders = [ { name: "Netflix", id: "8" }, - { name: "Apple TV", id: "2" }, + { name: "Apple TV+", id: "2" }, { name: "Amazon Prime Video", id: "10" }, { name: "Hulu", id: "15" }, { name: "Max", id: "1899" }, { name: "Paramount Plus", id: "531" }, { name: "Disney Plus", id: "337" }, { name: "Shudder", id: "99" }, - // More movie providers can be added here ]; const tvProviders = [ { name: "Netflix", id: "8" }, { name: "Apple TV+", id: "350" }, - { name: "Amazon Prime Video", id: "119" }, { name: "Paramount Plus", id: "531" }, { name: "Hulu", id: "15" }, { name: "Max", id: "1899" }, { name: "Disney Plus", id: "337" }, { name: "fubuTV", id: "257" }, - // More TV providers can be added here ]; const [countdown, setCountdown] = useState(null); @@ -160,7 +157,7 @@ export function DiscoverContent() { const [editorPicksData, setEditorPicksData] = useState([]); - // New state to track selected category (movies or TV shows) + // State to track selected category (movies or TV shows) const [selectedCategory, setSelectedCategory] = useState("movies"); // Handle category change @@ -755,6 +752,46 @@ export function DiscoverContent() { return buttons; }; + const renderMovieProviderButtons = () => { + const buttons = []; + // Movie Providers + // eslint-disable-next-line @typescript-eslint/no-unused-vars + for (const [index, provider] of movieProviders.entries()) { + buttons.push( + , + ); + } + return buttons; + }; + const renderTopTvButtons = () => { const buttons = []; // TV Categories @@ -813,6 +850,46 @@ export function DiscoverContent() { return buttons; }; + const renderTvProviderButtons = () => { + const buttons = []; + // Movie Providers + // eslint-disable-next-line @typescript-eslint/no-unused-vars + for (const [index, provider] of tvProviders.entries()) { + buttons.push( + , + ); + } + return buttons; + }; + const renderScrollButton = ( categorySlug: string, direction: "left" | "right", @@ -899,51 +976,84 @@ export function DiscoverContent() { - {/* Conditionally render Movies or TV Shows based on selectedCategory */} + {/* Render Movies */} {selectedCategory === "movies" && ( -
- {!isMobile &&
{renderScrollButton("movies", "left")}
} - +

Shows

@@ -1050,6 +1164,42 @@ export function DiscoverContent() {
))}
+