From 0fa62191e1033e2a9e67c44e71719ed352422c42 Mon Sep 17 00:00:00 2001 From: Cooper Ransom Date: Fri, 15 Mar 2024 23:02:11 -0400 Subject: [PATCH] Perfect direct links and add buttons that link to TopFlix and Support to about us --- src/components/layout/Navigation.tsx | 2 +- src/pages/About.tsx | 38 ++++++++++++++++++++++++++++ src/pages/TopFlix.tsx | 23 ++++++++++------- 3 files changed, 53 insertions(+), 10 deletions(-) diff --git a/src/components/layout/Navigation.tsx b/src/components/layout/Navigation.tsx index 79739ea8..2d5fca3e 100644 --- a/src/components/layout/Navigation.tsx +++ b/src/components/layout/Navigation.tsx @@ -103,7 +103,7 @@ export function Navigation(props: NavigationProps) { diff --git a/src/pages/About.tsx b/src/pages/About.tsx index a8a54cd6..d5724fcc 100644 --- a/src/pages/About.tsx +++ b/src/pages/About.tsx @@ -1,4 +1,6 @@ +import classNames from "classnames"; import { useTranslation } from "react-i18next"; +import { Link } from "react-router-dom"; import { ThinContainer } from "@/components/layout/ThinContainer"; import { Ol } from "@/components/utils/Ol"; @@ -16,6 +18,27 @@ function Question(props: { title: string; children: React.ReactNode }) { ); } +function Button(props: { + className: string; + onClick?: () => void; + children: React.ReactNode; + disabled?: boolean; +}) { + return ( + + ); +} + export function AboutPage() { const { t } = useTranslation(); return ( @@ -44,6 +67,21 @@ export function AboutPage() { , ]} /> +
+ + + + + + +
); diff --git a/src/pages/TopFlix.tsx b/src/pages/TopFlix.tsx index d10cecfa..550aa3bc 100644 --- a/src/pages/TopFlix.tsx +++ b/src/pages/TopFlix.tsx @@ -31,9 +31,9 @@ function Button(props: { ); } -function isShowOrMovie(tmdbFullId: string): "show" | "movie" | "unknown" { +function isShowOrMovie(tmdbFullId: string): "series" | "movie" | "unknown" { if (tmdbFullId.includes("show-")) { - return "show"; + return "series"; } if (tmdbFullId.includes("movie-")) { return "movie"; @@ -42,12 +42,15 @@ function isShowOrMovie(tmdbFullId: string): "show" | "movie" | "unknown" { } function directLinkToContent(tmdbFullId: string) { - const currentDomain = window.location.href.split("#")[0]; - if (isShowOrMovie(tmdbFullId) === "show") { - return `${currentDomain}/media/tmdb-movie-${tmdbFullId.split("-")[1]}`; + if (isShowOrMovie(tmdbFullId) === "series") { + return `${window.location.pathname}#/media/tmdb-movie-${ + tmdbFullId.split("-")[1] + }`; } if (isShowOrMovie(tmdbFullId) === "movie") { - return `${currentDomain}/media/tmdb-tv-${tmdbFullId.split("-")[1]}`; + return `${window.location.pathname}#/media/tmdb-tv-${ + tmdbFullId.split("-")[1] + }`; } return null; } @@ -61,7 +64,7 @@ function ConfigValue(props: { return ( <>
-

+

{link ? ( {props.name} @@ -70,7 +73,7 @@ function ConfigValue(props: {

{props.name}

)}

-

{props.children}

+

{props.children}

@@ -207,7 +210,9 @@ export function TopFlix() { id={item.tmdbFullId} name={item.title} > - {`${item.providerId} - Views: `} + {`${item.providerId}, ${isShowOrMovie( + item.tmdbFullId, + )} - Views: `} {item.count} );