mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-03-10 11:36:18 +00:00
feat(tv): add favorite button to item detail page
This commit is contained in:
@@ -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>
|
||||
|
||||
|
||||
23
components/tv/TVFavoriteButton.tsx
Normal file
23
components/tv/TVFavoriteButton.tsx
Normal 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>
|
||||
);
|
||||
};
|
||||
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user