mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-03-15 05:46:29 +00:00
feat(tv): add favorite button to series detail page
This commit is contained in:
@@ -29,6 +29,7 @@ import { getItemNavigation } from "@/components/common/TouchableItemRouter";
|
||||
import { seasonIndexAtom } from "@/components/series/SeasonPicker";
|
||||
import { TVEpisodeList } from "@/components/series/TVEpisodeList";
|
||||
import { TVSeriesHeader } from "@/components/series/TVSeriesHeader";
|
||||
import { TVFavoriteButton } from "@/components/tv/TVFavoriteButton";
|
||||
import { useScaledTVTypography } from "@/constants/TVTypography";
|
||||
import useRouter from "@/hooks/useAppRouter";
|
||||
import { useTVSeriesSeasonModal } from "@/hooks/useTVSeriesSeasonModal";
|
||||
@@ -577,6 +578,8 @@ export const TVSeriesPage: React.FC<TVSeriesPageProps> = ({
|
||||
</Text>
|
||||
</TVFocusableButton>
|
||||
|
||||
<TVFavoriteButton item={item} disabled={isSeasonModalVisible} />
|
||||
|
||||
{seasons.length > 1 && (
|
||||
<TVSeasonButton
|
||||
seasonName={selectedSeasonName}
|
||||
|
||||
@@ -6,13 +6,22 @@ import { TVButton } from "./TVButton";
|
||||
|
||||
export interface TVFavoriteButtonProps {
|
||||
item: BaseItemDto;
|
||||
disabled?: boolean;
|
||||
}
|
||||
|
||||
export const TVFavoriteButton: React.FC<TVFavoriteButtonProps> = ({ item }) => {
|
||||
export const TVFavoriteButton: React.FC<TVFavoriteButtonProps> = ({
|
||||
item,
|
||||
disabled,
|
||||
}) => {
|
||||
const { isFavorite, toggleFavorite } = useFavorite(item);
|
||||
|
||||
return (
|
||||
<TVButton onPress={toggleFavorite} variant='glass' square>
|
||||
<TVButton
|
||||
onPress={toggleFavorite}
|
||||
variant='glass'
|
||||
square
|
||||
disabled={disabled}
|
||||
>
|
||||
<Ionicons
|
||||
name={isFavorite ? "heart" : "heart-outline"}
|
||||
size={28}
|
||||
|
||||
Reference in New Issue
Block a user