mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-06-11 00:10:24 +01:00
add header to 'see all' pages and change headers
This commit is contained in:
@@ -59,8 +59,9 @@ export default function FavoritesPage() {
|
||||
<Favorites
|
||||
filter='Likes'
|
||||
queryKeyBase='watchlist'
|
||||
emptyTitleKey='favorites.noWatchlistTitle'
|
||||
emptyTextKey='favorites.noWatchlistData'
|
||||
seeAllNamespace='kefintweaksWatchlist'
|
||||
emptyTitleKey='kefintweaksWatchlist.noDataTitle'
|
||||
emptyTextKey='kefintweaksWatchlist.noData'
|
||||
/>
|
||||
) : (
|
||||
<Favorites />
|
||||
|
||||
@@ -11,7 +11,7 @@ import { Stack, useLocalSearchParams } from "expo-router";
|
||||
import { t } from "i18next";
|
||||
import { useAtom } from "jotai";
|
||||
import { useCallback, useMemo } from "react";
|
||||
import { useWindowDimensions, View } from "react-native";
|
||||
import { Platform, useWindowDimensions, View } from "react-native";
|
||||
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
||||
import { Text } from "@/components/common/Text";
|
||||
import { TouchableItemRouter } from "@/components/common/TouchableItemRouter";
|
||||
@@ -160,7 +160,7 @@ export default function FavoritesSeeAllScreen() {
|
||||
options={{
|
||||
headerTitle: headerTitle,
|
||||
headerBlurEffect: "none",
|
||||
headerTransparent: true,
|
||||
headerTransparent: Platform.OS === "ios",
|
||||
headerShadowVisible: false,
|
||||
}}
|
||||
/>
|
||||
|
||||
@@ -32,6 +32,8 @@ interface FavoritesProps {
|
||||
queryKeyBase?: string;
|
||||
emptyTitleKey?: string;
|
||||
emptyTextKey?: string;
|
||||
/** Namespace for the see-all page headers ("favorites" or "kefintweaksWatchlist"). */
|
||||
seeAllNamespace?: string;
|
||||
}
|
||||
|
||||
export const Favorites = ({
|
||||
@@ -39,6 +41,7 @@ export const Favorites = ({
|
||||
queryKeyBase = "favorites",
|
||||
emptyTitleKey = "favorites.noDataTitle",
|
||||
emptyTextKey = "favorites.noData",
|
||||
seeAllNamespace = "favorites",
|
||||
}: FavoritesProps = {}) => {
|
||||
const router = useRouter();
|
||||
const [api] = useAtom(apiAtom);
|
||||
@@ -143,44 +146,68 @@ export const Favorites = ({
|
||||
const handleSeeAllSeries = useCallback(() => {
|
||||
router.push({
|
||||
pathname: "/(auth)/(tabs)/(favorites)/see-all",
|
||||
params: { type: "Series", title: t("favorites.series"), filter },
|
||||
params: {
|
||||
type: "Series",
|
||||
title: t(`${seeAllNamespace}.seeAllSeries`),
|
||||
filter,
|
||||
},
|
||||
} as any);
|
||||
}, [router, filter]);
|
||||
}, [router, filter, seeAllNamespace]);
|
||||
|
||||
const handleSeeAllMovies = useCallback(() => {
|
||||
router.push({
|
||||
pathname: "/(auth)/(tabs)/(favorites)/see-all",
|
||||
params: { type: "Movie", title: t("favorites.movies"), filter },
|
||||
params: {
|
||||
type: "Movie",
|
||||
title: t(`${seeAllNamespace}.seeAllMovies`),
|
||||
filter,
|
||||
},
|
||||
} as any);
|
||||
}, [router, filter]);
|
||||
}, [router, filter, seeAllNamespace]);
|
||||
|
||||
const handleSeeAllEpisodes = useCallback(() => {
|
||||
router.push({
|
||||
pathname: "/(auth)/(tabs)/(favorites)/see-all",
|
||||
params: { type: "Episode", title: t("favorites.episodes"), filter },
|
||||
params: {
|
||||
type: "Episode",
|
||||
title: t(`${seeAllNamespace}.seeAllEpisodes`),
|
||||
filter,
|
||||
},
|
||||
} as any);
|
||||
}, [router, filter]);
|
||||
}, [router, filter, seeAllNamespace]);
|
||||
|
||||
const handleSeeAllVideos = useCallback(() => {
|
||||
router.push({
|
||||
pathname: "/(auth)/(tabs)/(favorites)/see-all",
|
||||
params: { type: "Video", title: t("favorites.videos"), filter },
|
||||
params: {
|
||||
type: "Video",
|
||||
title: t(`${seeAllNamespace}.seeAllVideos`),
|
||||
filter,
|
||||
},
|
||||
} as any);
|
||||
}, [router, filter]);
|
||||
}, [router, filter, seeAllNamespace]);
|
||||
|
||||
const handleSeeAllBoxsets = useCallback(() => {
|
||||
router.push({
|
||||
pathname: "/(auth)/(tabs)/(favorites)/see-all",
|
||||
params: { type: "BoxSet", title: t("favorites.boxsets"), filter },
|
||||
params: {
|
||||
type: "BoxSet",
|
||||
title: t(`${seeAllNamespace}.seeAllBoxsets`),
|
||||
filter,
|
||||
},
|
||||
} as any);
|
||||
}, [router, filter]);
|
||||
}, [router, filter, seeAllNamespace]);
|
||||
|
||||
const handleSeeAllPlaylists = useCallback(() => {
|
||||
router.push({
|
||||
pathname: "/(auth)/(tabs)/(favorites)/see-all",
|
||||
params: { type: "Playlist", title: t("favorites.playlists"), filter },
|
||||
params: {
|
||||
type: "Playlist",
|
||||
title: t(`${seeAllNamespace}.seeAllPlaylists`),
|
||||
filter,
|
||||
},
|
||||
} as any);
|
||||
}, [router, filter]);
|
||||
}, [router, filter, seeAllNamespace]);
|
||||
|
||||
return (
|
||||
<View className='flex flex-co gap-y-4'>
|
||||
|
||||
@@ -6,7 +6,7 @@ import type {
|
||||
import { getItemsApi } from "@jellyfin/sdk/lib/utils/api";
|
||||
import { Image } from "expo-image";
|
||||
import { useAtom } from "jotai";
|
||||
import { useCallback, useEffect, useMemo, useState } from "react";
|
||||
import { useCallback, useEffect, useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { ScrollView, View } from "react-native";
|
||||
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
||||
@@ -50,20 +50,14 @@ export const Favorites = () => {
|
||||
watchlistEnabled && viewType === "Watchlist" ? "Likes" : "IsFavorite";
|
||||
const queryKeyBase =
|
||||
watchlistEnabled && viewType === "Watchlist" ? "watchlist" : "favorites";
|
||||
const emptyTitleKey = useMemo(
|
||||
() =>
|
||||
watchlistEnabled && viewType === "Watchlist"
|
||||
? "favorites.noWatchlistTitle"
|
||||
: "favorites.noDataTitle",
|
||||
[watchlistEnabled, viewType],
|
||||
);
|
||||
const emptyTextKey = useMemo(
|
||||
() =>
|
||||
watchlistEnabled && viewType === "Watchlist"
|
||||
? "favorites.noWatchlistData"
|
||||
: "favorites.noData",
|
||||
[watchlistEnabled, viewType],
|
||||
);
|
||||
// Translation namespace for the empty state, swapped for the KefinTweaks
|
||||
// watchlist (Likes-backed) view. Section titles stay generic ("Series").
|
||||
const emptyNamespace =
|
||||
watchlistEnabled && viewType === "Watchlist"
|
||||
? "kefintweaksWatchlist"
|
||||
: "favorites";
|
||||
const emptyTitleKey = `${emptyNamespace}.noDataTitle`;
|
||||
const emptyTextKey = `${emptyNamespace}.noData`;
|
||||
|
||||
const [emptyState, setEmptyState] = useState<EmptyState>({
|
||||
Series: false,
|
||||
|
||||
@@ -593,11 +593,25 @@
|
||||
"videos": "Videos",
|
||||
"boxsets": "Box sets",
|
||||
"playlists": "Playlists",
|
||||
"seeAllSeries": "Favorited Series",
|
||||
"seeAllMovies": "Favorited Movies",
|
||||
"seeAllEpisodes": "Favorited Episodes",
|
||||
"seeAllVideos": "Favorited Videos",
|
||||
"seeAllBoxsets": "Favorited Box sets",
|
||||
"seeAllPlaylists": "Favorited Playlists",
|
||||
"noDataTitle": "No favorites yet",
|
||||
"noData": "Mark items as favorites to see them appear here for quick access.",
|
||||
"watchlist": "Watchlist",
|
||||
"noWatchlistTitle": "No watchlisted items yet",
|
||||
"noWatchlistData": "Add items to your watchlist to see them appear here."
|
||||
"watchlist": "Watchlist"
|
||||
},
|
||||
"kefintweaksWatchlist": {
|
||||
"seeAllSeries": "Watchlisted Series",
|
||||
"seeAllMovies": "Watchlisted Movies",
|
||||
"seeAllEpisodes": "Watchlisted Episodes",
|
||||
"seeAllVideos": "Watchlisted Videos",
|
||||
"seeAllBoxsets": "Watchlisted Box sets",
|
||||
"seeAllPlaylists": "Watchlisted Playlists",
|
||||
"noDataTitle": "No watchlisted items yet",
|
||||
"noData": "Add items to your watchlist to see them appear here."
|
||||
},
|
||||
"custom_links": {
|
||||
"no_links": "No links"
|
||||
|
||||
@@ -675,11 +675,25 @@
|
||||
"videos": "Videor",
|
||||
"boxsets": "Box Set",
|
||||
"playlists": "Spellistor",
|
||||
"seeAllSeries": "Favoritmarkerade serier",
|
||||
"seeAllMovies": "Favoritmarkerade filmer",
|
||||
"seeAllEpisodes": "Favoritmarkerade avsnitt",
|
||||
"seeAllVideos": "Favoritmarkerade videor",
|
||||
"seeAllBoxsets": "Favoritmarkerade box set",
|
||||
"seeAllPlaylists": "Favoritmarkerade spellistor",
|
||||
"noDataTitle": "Inga favoriter än",
|
||||
"noData": "Markera objekt som favoriter för att se dem visas här för snabb åtkomst.",
|
||||
"watchlist": "Bevakningslista",
|
||||
"noWatchlistTitle": "Inga bevakade objekt än",
|
||||
"noWatchlistData": "Lägg till objekt i din bevakningslista för att se dem visas här."
|
||||
"watchlist": "Bevakningslista"
|
||||
},
|
||||
"kefintweaksWatchlist": {
|
||||
"seeAllSeries": "Bevakade serier",
|
||||
"seeAllMovies": "Bevakade filmer",
|
||||
"seeAllEpisodes": "Bevakade avsnitt",
|
||||
"seeAllVideos": "Bevakade videor",
|
||||
"seeAllBoxsets": "Bevakade box set",
|
||||
"seeAllPlaylists": "Bevakade spellistor",
|
||||
"noDataTitle": "Inga bevakade objekt än",
|
||||
"noData": "Lägg till objekt i din bevakningslista för att se dem visas här."
|
||||
},
|
||||
"custom_links": {
|
||||
"no_links": "Inga Länkar"
|
||||
|
||||
Reference in New Issue
Block a user