diff --git a/components/home/Favorites.tsx b/components/home/Favorites.tsx index adc15946..2be55074 100644 --- a/components/home/Favorites.tsx +++ b/components/home/Favorites.tsx @@ -143,14 +143,22 @@ export const Favorites = ({ [fetchFavoritesByType, pageSize], ); - // Navigate to the shared see-all screen. `titleKey` is the see-all header - // segment in the active namespace (e.g. "seeAllSeries"). The cast is needed - // because the route's custom params aren't part of expo-router's typed Href. + // Navigate to the shared see-all screen. `name` is the capitalized type + // suffix of the see-all header key (e.g. "Series" -> "seeAllSeries"). + // The namespace is branched explicitly so each t() call has a static prefix + // (favorites.seeAll* / kefintweaksWatchlist.seeAll*) that the i18n usage + // checker can detect — see scripts/check-i18n-keys.mjs. The `as any` is + // needed because the route's custom params aren't part of expo-router's + // typed Href. const seeAll = useCallback( - (type: FavoriteTypes, titleKey: string) => { + (type: FavoriteTypes, name: string) => { + const title = + seeAllNamespace === "kefintweaksWatchlist" + ? t(`kefintweaksWatchlist.seeAll${name}`) + : t(`favorites.seeAll${name}`); router.push({ pathname: "/(auth)/(tabs)/(favorites)/see-all", - params: { type, title: t(`${seeAllNamespace}.${titleKey}`), filter }, + params: { type, title, filter }, } as any); }, [router, filter, seeAllNamespace], @@ -180,7 +188,7 @@ export const Favorites = ({ title={t("favorites.series")} hideIfEmpty pageSize={pageSize} - onPressSeeAll={() => seeAll("Series", "seeAllSeries")} + onPressSeeAll={() => seeAll("Series", "Series")} /> seeAll("Movie", "seeAllMovies")} + onPressSeeAll={() => seeAll("Movie", "Movies")} /> seeAll("Episode", "seeAllEpisodes")} + onPressSeeAll={() => seeAll("Episode", "Episodes")} /> seeAll("Video", "seeAllVideos")} + onPressSeeAll={() => seeAll("Video", "Videos")} /> seeAll("BoxSet", "seeAllBoxsets")} + onPressSeeAll={() => seeAll("BoxSet", "Boxsets")} /> seeAll("Playlist", "seeAllPlaylists")} + onPressSeeAll={() => seeAll("Playlist", "Playlists")} /> );