From d35bd0379d206d85701718fb36605a15327d0b35 Mon Sep 17 00:00:00 2001 From: Cooper Ransom Date: Wed, 10 Apr 2024 22:31:19 -0400 Subject: [PATCH] add character limit for titles --- src/pages/Discover.tsx | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/pages/Discover.tsx b/src/pages/Discover.tsx index cdfca449..ddec9b21 100644 --- a/src/pages/Discover.tsx +++ b/src/pages/Discover.tsx @@ -8,7 +8,6 @@ import { Divider } from "@/components/utils/Divider"; import { Flare } from "@/components/utils/Flare"; import { HomeLayout } from "@/pages/layouts/HomeLayout"; import { conf } from "@/setup/config"; -import { useThemeStore } from "@/stores/theme"; import { Category, Genre, @@ -20,7 +19,6 @@ import { } from "@/utils/discover"; import { PageTitle } from "./parts/util/PageTitle"; -import { allThemes } from "../../themes/all"; import { get } from "../backend/metadata/tmdb"; import { Icon, Icons } from "../components/Icon"; @@ -33,10 +31,6 @@ export function Discover() { [genreId: number]: Movie[]; }>({}); const [countdown, setCountdown] = useState(null); - const themeName = useThemeStore((s) => s.theme); - const currentTheme = allThemes.find((y) => y.name === themeName); - const bgColor = - currentTheme?.extend?.colors?.background?.accentA ?? "#7831BF"; const navigate = useNavigate(); const [categoryShows, setCategoryShows] = useState<{ [categoryName: string]: Movie[]; @@ -253,7 +247,7 @@ export function Discover() { : `${category} Movies`; return (
-

+

{displayCategory}

- {isTVShow ? media.name : media.title} + {isTVShow + ? (media.name?.length ?? 0) > 36 + ? `${media.name?.slice(0, 36)}...` + : media.name + : (media.title?.length ?? 0) > 36 + ? `${media.title?.slice(0, 36)}...` + : media.title}

@@ -311,7 +311,7 @@ export function Discover() {