mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-01-15 15:48:05 +00:00
Some checks failed
🤖 Android APK Build / 🏗️ Build Android APK (push) Has been cancelled
🤖 iOS IPA Build / 🏗️ Build iOS IPA (push) Has been cancelled
🔒 Lockfile Consistency Check / 🔍 Check bun.lock and package.json consistency (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
🕒 Handle Stale Issues / 🗑️ Cleanup Stale Issues (push) Has been cancelled
37 lines
1.1 KiB
TypeScript
37 lines
1.1 KiB
TypeScript
import { useCallback, useState } from "react";
|
|
import { RefreshControl, ScrollView, View } from "react-native";
|
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
import { Favorites } from "@/components/home/Favorites";
|
|
import { useInvalidatePlaybackProgressCache } from "@/hooks/useRevalidatePlaybackProgressCache";
|
|
|
|
export default function favorites() {
|
|
const invalidateCache = useInvalidatePlaybackProgressCache();
|
|
|
|
const [loading, setLoading] = useState(false);
|
|
const refetch = useCallback(async () => {
|
|
setLoading(true);
|
|
await invalidateCache();
|
|
setLoading(false);
|
|
}, []);
|
|
const insets = useSafeAreaInsets();
|
|
|
|
return (
|
|
<ScrollView
|
|
nestedScrollEnabled
|
|
contentInsetAdjustmentBehavior='automatic'
|
|
refreshControl={
|
|
<RefreshControl refreshing={loading} onRefresh={refetch} />
|
|
}
|
|
contentContainerStyle={{
|
|
paddingLeft: insets.left,
|
|
paddingRight: insets.right,
|
|
paddingBottom: 16,
|
|
}}
|
|
>
|
|
<View className='my-4'>
|
|
<Favorites />
|
|
</View>
|
|
</ScrollView>
|
|
);
|
|
}
|