From 4705c9f4f989be81935e801cc91a117424f598e7 Mon Sep 17 00:00:00 2001 From: Fredrik Burmester Date: Mon, 19 Jan 2026 20:01:00 +0100 Subject: [PATCH] feat(tv): add favorite button to item detail page --- components/ItemContent.tv.tsx | 2 ++ components/tv/TVFavoriteButton.tsx | 23 +++++++++++++++++++++++ components/tv/index.ts | 2 ++ 3 files changed, 27 insertions(+) create mode 100644 components/tv/TVFavoriteButton.tsx diff --git a/components/ItemContent.tv.tsx b/components/ItemContent.tv.tsx index c19644b1..ac4fad32 100644 --- a/components/ItemContent.tv.tsx +++ b/components/ItemContent.tv.tsx @@ -22,6 +22,7 @@ import { TVButton, TVCastCrewText, TVCastSection, + TVFavoriteButton, TVMetadataBadges, TVOptionButton, TVProgressBar, @@ -578,6 +579,7 @@ export const ItemContentTV: React.FC = React.memo( : t("common.play")} + diff --git a/components/tv/TVFavoriteButton.tsx b/components/tv/TVFavoriteButton.tsx new file mode 100644 index 00000000..6be3f977 --- /dev/null +++ b/components/tv/TVFavoriteButton.tsx @@ -0,0 +1,23 @@ +import { Ionicons } from "@expo/vector-icons"; +import type { BaseItemDto } from "@jellyfin/sdk/lib/generated-client"; +import React from "react"; +import { useFavorite } from "@/hooks/useFavorite"; +import { TVButton } from "./TVButton"; + +export interface TVFavoriteButtonProps { + item: BaseItemDto; +} + +export const TVFavoriteButton: React.FC = ({ item }) => { + const { isFavorite, toggleFavorite } = useFavorite(item); + + return ( + + + + ); +}; diff --git a/components/tv/index.ts b/components/tv/index.ts index d05dc8df..3620945d 100644 --- a/components/tv/index.ts +++ b/components/tv/index.ts @@ -23,6 +23,8 @@ export { TVCastSection } from "./TVCastSection"; // Player control components export type { TVControlButtonProps } from "./TVControlButton"; export { TVControlButton } from "./TVControlButton"; +export type { TVFavoriteButtonProps } from "./TVFavoriteButton"; +export { TVFavoriteButton } from "./TVFavoriteButton"; export type { TVFocusablePosterProps } from "./TVFocusablePoster"; export { TVFocusablePoster } from "./TVFocusablePoster"; export type { TVLanguageCardProps } from "./TVLanguageCard";