From 79d30cad19d78d9fb9f969687af9a7f730619abf Mon Sep 17 00:00:00 2001 From: Captain Jack Sparrow <163903675+sussy-code@users.noreply.github.com> Date: Sun, 16 Jun 2024 02:59:21 +0000 Subject: [PATCH] Now mobile looks epic! --- src/components/media/ModalEpisodeSelector.tsx | 11 +++++++ src/components/media/PopupModal.tsx | 31 +++++++++---------- 2 files changed, 25 insertions(+), 17 deletions(-) create mode 100644 src/components/media/ModalEpisodeSelector.tsx diff --git a/src/components/media/ModalEpisodeSelector.tsx b/src/components/media/ModalEpisodeSelector.tsx new file mode 100644 index 00000000..f4716589 --- /dev/null +++ b/src/components/media/ModalEpisodeSelector.tsx @@ -0,0 +1,11 @@ +// We make a episode selector modal component that will be used in the media page to select the episode to play. + +// import { get } from "../backend/metadata/tmdb"; +// (or whatever the relevant path is to backend/metadata/tmdb) +// import { conf } from "@/setup/config"; + +// const data = await get("/tv)/[tmdbID-HERE]/season/[seasonNumber-HERE]", { +// api_key: conf().TMDB_READ_API_KEY, +// language: "en-US", +// }); +// Then data will return json of the season information including all the episode names. So just call data.episodes to get a json output of all the episode info diff --git a/src/components/media/PopupModal.tsx b/src/components/media/PopupModal.tsx index 84db29a6..959145bf 100644 --- a/src/components/media/PopupModal.tsx +++ b/src/components/media/PopupModal.tsx @@ -153,22 +153,24 @@ export function PopupModal({ >
-
-
+
+
{data?.backdrop_path ? ( {media.poster ) : ( )}
-

+

{data?.title || data?.name ? ( data?.title || data?.name ) : ( @@ -182,7 +184,7 @@ export function PopupModal({ {displayCertification}

) : ( -
+ ) ) : (
@@ -194,7 +196,7 @@ export function PopupModal({ return releaseInfo && releaseInfo.rating ? ( releaseInfo.rating ) : ( -
+ ); })()} @@ -206,7 +208,7 @@ export function PopupModal({ data?.runtime ? ( formatRuntime(data.runtime) ) : ( -
+ ) ) : null}
@@ -214,13 +216,13 @@ export function PopupModal({ data?.release_date ? ( String(data.release_date).split("-")[0] ) : ( -
+ ) ) : media.type === "show" ? ( data?.first_air_date ? ( String(data.first_air_date).split("-")[0] ) : ( -
+ ) ) : null}
@@ -249,14 +251,9 @@ export function PopupModal({ {genre.name}
)) - : Array.from({ length: 3 }).map((_) => ( -
- ))} + : Array.from({ length: 3 }).map((_) => )}
-
+
{data?.overview}
@@ -267,7 +264,7 @@ export function PopupModal({ `/media/tmdb-${isTVShow ? "tv" : "movie"}-${media.id}-${media.title}`, ) } - className="text-2xl font-bold hover:bg-purple-700 transition-all duration-[0.3s] hover:scale-105" + className="text-xl sm:text-2xl font-bold hover:bg-purple-700 transition-all duration-[0.3s] hover:scale-105" >