feat(tv): add favorite button to item detail page

This commit is contained in:
Fredrik Burmester
2026-01-19 20:01:00 +01:00
parent 2b36d4bc76
commit 4705c9f4f9
3 changed files with 27 additions and 0 deletions

View File

@@ -22,6 +22,7 @@ import {
TVButton,
TVCastCrewText,
TVCastSection,
TVFavoriteButton,
TVMetadataBadges,
TVOptionButton,
TVProgressBar,
@@ -578,6 +579,7 @@ export const ItemContentTV: React.FC<ItemContentTVProps> = React.memo(
: t("common.play")}
</Text>
</TVButton>
<TVFavoriteButton item={item} />
<TVRefreshButton itemId={item.Id} />
</View>

View File

@@ -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<TVFavoriteButtonProps> = ({ item }) => {
const { isFavorite, toggleFavorite } = useFavorite(item);
return (
<TVButton onPress={toggleFavorite} variant='glass' square>
<Ionicons
name={isFavorite ? "heart" : "heart-outline"}
size={28}
color='#FFFFFF'
/>
</TVButton>
);
};

View File

@@ -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";