From 9dc2e0099bc96150eb5a2dff45d90e2720471264 Mon Sep 17 00:00:00 2001 From: Pas <74743263+Pasithea0@users.noreply.github.com> Date: Sun, 6 Jul 2025 16:22:20 -0600 Subject: [PATCH] Readd email to DMCA page --- src/components/layout/Footer.tsx | 2 ++ src/pages/Dmca.tsx | 38 +++++++++++++++++++++++++++++--- src/setup/App.tsx | 6 +++-- src/utils/setup/App.tsx | 6 +++-- 4 files changed, 45 insertions(+), 7 deletions(-) diff --git a/src/components/layout/Footer.tsx b/src/components/layout/Footer.tsx index 6bd5abcf..6f05705c 100644 --- a/src/components/layout/Footer.tsx +++ b/src/components/layout/Footer.tsx @@ -6,6 +6,7 @@ import type { RequireExactlyOne } from "type-fest"; import { Icon, Icons } from "@/components/Icon"; import { BrandPill } from "@/components/layout/BrandPill"; import { WideContainer } from "@/components/layout/WideContainer"; +import { shouldHaveDmcaPage } from "@/pages/Dmca"; import { conf } from "@/setup/config"; // to and href are mutually exclusive @@ -45,6 +46,7 @@ function FooterLink(props: FooterLinkProps) { function Dmca() { const { t } = useTranslation(); + if (!shouldHaveDmcaPage()) return null; if (window.location.hash === "#/dmca") return null; return ( diff --git a/src/pages/Dmca.tsx b/src/pages/Dmca.tsx index ba8db0b1..191aad94 100644 --- a/src/pages/Dmca.tsx +++ b/src/pages/Dmca.tsx @@ -1,25 +1,57 @@ +import React, { useState } from "react"; import { useTranslation } from "react-i18next"; +import { Icon, Icons } from "@/components/Icon"; import { ThinContainer } from "@/components/layout/ThinContainer"; -import { Heading1 } from "@/components/utils/Text"; +import { Heading1, Paragraph } from "@/components/utils/Text"; import { PageTitle } from "@/pages/parts/util/PageTitle"; +import { conf } from "@/setup/config"; import { SubPageLayout } from "./layouts/SubPageLayout"; +export function shouldHaveDmcaPage() { + return !!conf().DMCA_EMAIL; +} + export function DmcaPage() { const { t } = useTranslation(); + const [isHovered, setIsHovered] = useState(false); return ( {t("screens.dmca.title")} -

+

This site operates in compliance with the Digital Millennium Copyright Act (“DMCA“). We do not store any files on our servers. All videos and media content are hosted on third-party services. - Please remember that we do not manage the content. + Please remember that we do not host or manage the content. +
+
+ For questions or concerns, feel free to contact us!

+ + (The{" "} + + about + {" "} + page has more information about how we get our content.) + + + + setIsHovered(true)} + onMouseLeave={() => setIsHovered(false)} + > + {conf().DMCA_EMAIL ?? ""} + +
); diff --git a/src/setup/App.tsx b/src/setup/App.tsx index 601f94b8..de5c3b86 100644 --- a/src/setup/App.tsx +++ b/src/setup/App.tsx @@ -18,7 +18,7 @@ import VideoTesterView from "@/pages/developer/VideoTesterView"; import { DiscoverMore } from "@/pages/discover/AllMovieLists"; import { Discover } from "@/pages/discover/Discover"; import { MoreContent } from "@/pages/discover/MoreContent"; -import { DmcaPage } from "@/pages/Dmca"; +import { DmcaPage, shouldHaveDmcaPage } from "@/pages/Dmca"; import MaintenancePage from "@/pages/errors/MaintenancePage"; import { NotFoundPage } from "@/pages/errors/NotFoundPage"; import { HomePage } from "@/pages/HomePage"; @@ -164,7 +164,9 @@ function App() { /> } /> - } /> + {shouldHaveDmcaPage() ? ( + } /> + ) : null} {/* Support page */} } /> } /> diff --git a/src/utils/setup/App.tsx b/src/utils/setup/App.tsx index 27a013db..98184cb3 100644 --- a/src/utils/setup/App.tsx +++ b/src/utils/setup/App.tsx @@ -16,7 +16,7 @@ import { AboutPage } from "@/pages/About"; import { AdminPage } from "@/pages/admin/AdminPage"; import VideoTesterView from "@/pages/developer/VideoTesterView"; import { Discover } from "@/pages/discover/Discover"; -import { DmcaPage } from "@/pages/Dmca"; +import { DmcaPage, shouldHaveDmcaPage } from "@/pages/Dmca"; import MaintenancePage from "@/pages/errors/MaintenancePage"; import { NotFoundPage } from "@/pages/errors/NotFoundPage"; import { HomePage } from "@/pages/HomePage"; @@ -145,7 +145,9 @@ function App() { element={} /> } /> - } /> + {shouldHaveDmcaPage() ? ( + } /> + ) : null} {/* Support page */} } /> {/* Discover page */}