From bd4e5bb70a96a0a6bb8382d03253ae8567b63fd3 Mon Sep 17 00:00:00 2001 From: lance chant <13349722+lancechant@users.noreply.github.com> Date: Sat, 3 Jan 2026 20:58:17 +0200 Subject: [PATCH] fix: jellyseer categories (#1233) Signed-off-by: Lance Chant <13349722+lancechant@users.noreply.github.com> Co-authored-by: Fredrik Burmester --- .../jellyseerr/company/[companyId].tsx | 8 +-- components/jellyseerr/GridSkeleton.tsx | 21 +++++++ components/jellyseerr/ParallaxSlideShow.tsx | 56 ++++++++++++------- 3 files changed, 61 insertions(+), 24 deletions(-) create mode 100644 components/jellyseerr/GridSkeleton.tsx diff --git a/app/(auth)/(tabs)/(home,libraries,search,favorites,watchlists)/jellyseerr/company/[companyId].tsx b/app/(auth)/(tabs)/(home,libraries,search,favorites,watchlists)/jellyseerr/company/[companyId].tsx index cd9cc3cc..fdcd786c 100644 --- a/app/(auth)/(tabs)/(home,libraries,search,favorites,watchlists)/jellyseerr/company/[companyId].tsx +++ b/app/(auth)/(tabs)/(home,libraries,search,favorites,watchlists)/jellyseerr/company/[companyId].tsx @@ -21,19 +21,18 @@ export default function page() { companyId: string; name: string; image: string; - type: DiscoverSliderType; + type: DiscoverSliderType; //This gets converted to a string because it's a url param }; - const { data, fetchNextPage, hasNextPage } = useInfiniteQuery({ + const { data, fetchNextPage, hasNextPage, isLoading } = useInfiniteQuery({ queryKey: ["jellyseerr", "company", type, companyId], queryFn: async ({ pageParam }) => { const params: any = { page: Number(pageParam), }; - return jellyseerrApi?.discover( `${ - type === DiscoverSliderType.NETWORKS + Number(type) === DiscoverSliderType.NETWORKS ? Endpoints.DISCOVER_TV_NETWORK : Endpoints.DISCOVER_MOVIES_STUDIO }/${companyId}`, @@ -86,6 +85,7 @@ export default function page() { fetchNextPage(); } }} + isLoading={isLoading} logo={ = ({ index }) => { + return ( + + + + + + + + ); +}; diff --git a/components/jellyseerr/ParallaxSlideShow.tsx b/components/jellyseerr/ParallaxSlideShow.tsx index b4b75592..261da73d 100644 --- a/components/jellyseerr/ParallaxSlideShow.tsx +++ b/components/jellyseerr/ParallaxSlideShow.tsx @@ -11,6 +11,7 @@ import { Animated, View, type ViewProps } from "react-native"; import { useSafeAreaInsets } from "react-native-safe-area-context"; import { Text } from "@/components/common/Text"; import { ParallaxScrollView } from "@/components/ParallaxPage"; +import { GridSkeleton } from "./GridSkeleton"; const ANIMATION_ENTER = 250; const ANIMATION_EXIT = 250; @@ -28,6 +29,7 @@ interface Props { renderItem: (item: T, index: number) => Render; keyExtractor: (item: T) => string; onEndReached?: (() => void) | null | undefined; + isLoading?: boolean; } const ParallaxSlideShow = ({ @@ -40,6 +42,7 @@ const ParallaxSlideShow = ({ renderItem, keyExtractor, onEndReached, + isLoading = false, }: PropsWithChildren & ViewProps>) => { const insets = useSafeAreaInsets(); @@ -124,27 +127,40 @@ const ParallaxSlideShow = ({ {MainContent?.()} - - - No results - - - } - contentInsetAdjustmentBehavior='automatic' - ListHeaderComponent={ + {isLoading ? ( + {listHeader} - } - nestedScrollEnabled - showsVerticalScrollIndicator={false} - //@ts-expect-error - renderItem={({ item, index }) => renderItem(item, index)} - keyExtractor={keyExtractor} - numColumns={3} - ItemSeparatorComponent={() => } - /> + + + {Array.from({ length: 9 }, (_, i) => ( + + ))} + + + + ) : ( + + + No results + + + } + contentInsetAdjustmentBehavior='automatic' + ListHeaderComponent={ + {listHeader} + } + nestedScrollEnabled + showsVerticalScrollIndicator={false} + //@ts-expect-error + renderItem={({ item, index }) => renderItem(item, index)} + keyExtractor={keyExtractor} + numColumns={3} + ItemSeparatorComponent={() => } + /> + )}