mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-06-03 12:38:26 +01:00
fix: jellyseer categories (#1233)
Some checks failed
🏗️ Build Apps / 🤖 Build Android APK (Phone) (push) Has been cancelled
🏗️ Build Apps / 🤖 Build Android APK (TV) (push) Has been cancelled
🏗️ Build Apps / 🍎 Build iOS IPA (Phone) (push) Has been cancelled
🔒 Lockfile Consistency Check / 🔍 Check bun.lock and package.json consistency (push) Has been cancelled
🛡️ CodeQL Analysis / 🔎 Analyze with CodeQL (actions) (push) Has been cancelled
🛡️ CodeQL Analysis / 🔎 Analyze with CodeQL (javascript-typescript) (push) Has been cancelled
🏷️🔀Merge Conflict Labeler / 🏷️ Labeling Merge Conflicts (push) Has been cancelled
🌐 Translation Sync / sync-translations (push) Has been cancelled
🚦 Security & Quality Gate / 📝 Validate PR Title (push) Has been cancelled
🚦 Security & Quality Gate / 🔍 Vulnerable Dependencies (push) Has been cancelled
🚦 Security & Quality Gate / 🚑 Expo Doctor Check (push) Has been cancelled
🚦 Security & Quality Gate / 🔍 Lint & Test (check) (push) Has been cancelled
🚦 Security & Quality Gate / 🔍 Lint & Test (format) (push) Has been cancelled
🚦 Security & Quality Gate / 🔍 Lint & Test (lint) (push) Has been cancelled
🚦 Security & Quality Gate / 🔍 Lint & Test (typecheck) (push) Has been cancelled
Some checks failed
🏗️ Build Apps / 🤖 Build Android APK (Phone) (push) Has been cancelled
🏗️ Build Apps / 🤖 Build Android APK (TV) (push) Has been cancelled
🏗️ Build Apps / 🍎 Build iOS IPA (Phone) (push) Has been cancelled
🔒 Lockfile Consistency Check / 🔍 Check bun.lock and package.json consistency (push) Has been cancelled
🛡️ CodeQL Analysis / 🔎 Analyze with CodeQL (actions) (push) Has been cancelled
🛡️ CodeQL Analysis / 🔎 Analyze with CodeQL (javascript-typescript) (push) Has been cancelled
🏷️🔀Merge Conflict Labeler / 🏷️ Labeling Merge Conflicts (push) Has been cancelled
🌐 Translation Sync / sync-translations (push) Has been cancelled
🚦 Security & Quality Gate / 📝 Validate PR Title (push) Has been cancelled
🚦 Security & Quality Gate / 🔍 Vulnerable Dependencies (push) Has been cancelled
🚦 Security & Quality Gate / 🚑 Expo Doctor Check (push) Has been cancelled
🚦 Security & Quality Gate / 🔍 Lint & Test (check) (push) Has been cancelled
🚦 Security & Quality Gate / 🔍 Lint & Test (format) (push) Has been cancelled
🚦 Security & Quality Gate / 🔍 Lint & Test (lint) (push) Has been cancelled
🚦 Security & Quality Gate / 🔍 Lint & Test (typecheck) (push) Has been cancelled
Signed-off-by: Lance Chant <13349722+lancechant@users.noreply.github.com> Co-authored-by: Fredrik Burmester <fredrik.burmester@gmail.com>
This commit is contained in:
@@ -21,19 +21,18 @@ export default function page() {
|
|||||||
companyId: string;
|
companyId: string;
|
||||||
name: string;
|
name: string;
|
||||||
image: 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],
|
queryKey: ["jellyseerr", "company", type, companyId],
|
||||||
queryFn: async ({ pageParam }) => {
|
queryFn: async ({ pageParam }) => {
|
||||||
const params: any = {
|
const params: any = {
|
||||||
page: Number(pageParam),
|
page: Number(pageParam),
|
||||||
};
|
};
|
||||||
|
|
||||||
return jellyseerrApi?.discover(
|
return jellyseerrApi?.discover(
|
||||||
`${
|
`${
|
||||||
type === DiscoverSliderType.NETWORKS
|
Number(type) === DiscoverSliderType.NETWORKS
|
||||||
? Endpoints.DISCOVER_TV_NETWORK
|
? Endpoints.DISCOVER_TV_NETWORK
|
||||||
: Endpoints.DISCOVER_MOVIES_STUDIO
|
: Endpoints.DISCOVER_MOVIES_STUDIO
|
||||||
}/${companyId}`,
|
}/${companyId}`,
|
||||||
@@ -86,6 +85,7 @@ export default function page() {
|
|||||||
fetchNextPage();
|
fetchNextPage();
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
|
isLoading={isLoading}
|
||||||
logo={
|
logo={
|
||||||
<Image
|
<Image
|
||||||
id={companyId}
|
id={companyId}
|
||||||
|
|||||||
21
components/jellyseerr/GridSkeleton.tsx
Normal file
21
components/jellyseerr/GridSkeleton.tsx
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
import { View } from "react-native";
|
||||||
|
|
||||||
|
interface Props {
|
||||||
|
index: number;
|
||||||
|
}
|
||||||
|
// Dev note might be a good idea to standardize skeletons across the app and have one "file" for it.
|
||||||
|
export const GridSkeleton: React.FC<Props> = ({ index }) => {
|
||||||
|
return (
|
||||||
|
<View
|
||||||
|
key={index}
|
||||||
|
className='flex flex-col mr-2 h-auto'
|
||||||
|
style={{ width: "30.5%" }}
|
||||||
|
>
|
||||||
|
<View className='relative rounded-lg overflow-hidden border border-neutral-900 w-full mt-4 aspect-[10/15] bg-neutral-800' />
|
||||||
|
<View className='mt-2 flex flex-col w-full'>
|
||||||
|
<View className='h-4 bg-neutral-800 rounded mb-1' />
|
||||||
|
<View className='h-3 bg-neutral-800 rounded w-1/2' />
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
};
|
||||||
@@ -11,6 +11,7 @@ import { Animated, View, type ViewProps } from "react-native";
|
|||||||
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
||||||
import { Text } from "@/components/common/Text";
|
import { Text } from "@/components/common/Text";
|
||||||
import { ParallaxScrollView } from "@/components/ParallaxPage";
|
import { ParallaxScrollView } from "@/components/ParallaxPage";
|
||||||
|
import { GridSkeleton } from "./GridSkeleton";
|
||||||
|
|
||||||
const ANIMATION_ENTER = 250;
|
const ANIMATION_ENTER = 250;
|
||||||
const ANIMATION_EXIT = 250;
|
const ANIMATION_EXIT = 250;
|
||||||
@@ -28,6 +29,7 @@ interface Props<T> {
|
|||||||
renderItem: (item: T, index: number) => Render;
|
renderItem: (item: T, index: number) => Render;
|
||||||
keyExtractor: (item: T) => string;
|
keyExtractor: (item: T) => string;
|
||||||
onEndReached?: (() => void) | null | undefined;
|
onEndReached?: (() => void) | null | undefined;
|
||||||
|
isLoading?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
const ParallaxSlideShow = <T,>({
|
const ParallaxSlideShow = <T,>({
|
||||||
@@ -40,6 +42,7 @@ const ParallaxSlideShow = <T,>({
|
|||||||
renderItem,
|
renderItem,
|
||||||
keyExtractor,
|
keyExtractor,
|
||||||
onEndReached,
|
onEndReached,
|
||||||
|
isLoading = false,
|
||||||
}: PropsWithChildren<Props<T> & ViewProps>) => {
|
}: PropsWithChildren<Props<T> & ViewProps>) => {
|
||||||
const insets = useSafeAreaInsets();
|
const insets = useSafeAreaInsets();
|
||||||
|
|
||||||
@@ -124,27 +127,40 @@ const ParallaxSlideShow = <T,>({
|
|||||||
</View>
|
</View>
|
||||||
{MainContent?.()}
|
{MainContent?.()}
|
||||||
<View>
|
<View>
|
||||||
<FlashList
|
{isLoading ? (
|
||||||
data={data}
|
<View>
|
||||||
ListEmptyComponent={
|
|
||||||
<View className='flex flex-col items-center justify-center h-full'>
|
|
||||||
<Text className='font-bold text-xl text-neutral-500'>
|
|
||||||
No results
|
|
||||||
</Text>
|
|
||||||
</View>
|
|
||||||
}
|
|
||||||
contentInsetAdjustmentBehavior='automatic'
|
|
||||||
ListHeaderComponent={
|
|
||||||
<Text className='text-lg font-bold my-2'>{listHeader}</Text>
|
<Text className='text-lg font-bold my-2'>{listHeader}</Text>
|
||||||
}
|
<View className='px-4'>
|
||||||
nestedScrollEnabled
|
<View className='flex flex-row flex-wrap'>
|
||||||
showsVerticalScrollIndicator={false}
|
{Array.from({ length: 9 }, (_, i) => (
|
||||||
//@ts-expect-error
|
<GridSkeleton key={i} index={i} />
|
||||||
renderItem={({ item, index }) => renderItem(item, index)}
|
))}
|
||||||
keyExtractor={keyExtractor}
|
</View>
|
||||||
numColumns={3}
|
</View>
|
||||||
ItemSeparatorComponent={() => <View className='h-2 w-2' />}
|
</View>
|
||||||
/>
|
) : (
|
||||||
|
<FlashList
|
||||||
|
data={data}
|
||||||
|
ListEmptyComponent={
|
||||||
|
<View className='flex flex-col items-center justify-center h-full'>
|
||||||
|
<Text className='font-bold text-xl text-neutral-500'>
|
||||||
|
No results
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
}
|
||||||
|
contentInsetAdjustmentBehavior='automatic'
|
||||||
|
ListHeaderComponent={
|
||||||
|
<Text className='text-lg font-bold my-2'>{listHeader}</Text>
|
||||||
|
}
|
||||||
|
nestedScrollEnabled
|
||||||
|
showsVerticalScrollIndicator={false}
|
||||||
|
//@ts-expect-error
|
||||||
|
renderItem={({ item, index }) => renderItem(item, index)}
|
||||||
|
keyExtractor={keyExtractor}
|
||||||
|
numColumns={3}
|
||||||
|
ItemSeparatorComponent={() => <View className='h-2 w-2' />}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
</ParallaxScrollView>
|
</ParallaxScrollView>
|
||||||
|
|||||||
Reference in New Issue
Block a user