2026-03-10 19:04:18 +08:00
|
|
|
import { Stack } from 'expo-router';
|
2026-03-05 18:02:54 +08:00
|
|
|
import { StatusBar } from 'expo-status-bar';
|
2026-03-06 12:58:41 +08:00
|
|
|
import { SafeAreaProvider } from 'react-native-safe-area-context';
|
2026-03-10 19:04:18 +08:00
|
|
|
import { View } from 'react-native';
|
2026-03-05 18:02:54 +08:00
|
|
|
import { useEffect } from 'react';
|
|
|
|
|
import { useAuthStore } from '../store/authStore';
|
2026-03-17 22:18:05 +08:00
|
|
|
import { useDownloadStore } from '../store/downloadStore';
|
2026-03-19 16:34:56 +08:00
|
|
|
import { useSettingsStore } from '../store/settingsStore';
|
2026-03-10 19:04:18 +08:00
|
|
|
import { MiniPlayer } from '../components/MiniPlayer';
|
2026-03-05 18:02:54 +08:00
|
|
|
|
|
|
|
|
export default function RootLayout() {
|
|
|
|
|
const restore = useAuthStore(s => s.restore);
|
2026-03-17 22:18:05 +08:00
|
|
|
const loadDownloads = useDownloadStore(s => s.loadFromStorage);
|
2026-03-19 16:34:56 +08:00
|
|
|
const restoreSettings = useSettingsStore(s => s.restore);
|
2026-03-05 18:02:54 +08:00
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
restore();
|
2026-03-17 22:18:05 +08:00
|
|
|
loadDownloads();
|
2026-03-19 16:34:56 +08:00
|
|
|
restoreSettings();
|
2026-03-05 18:02:54 +08:00
|
|
|
}, []);
|
|
|
|
|
|
|
|
|
|
return (
|
2026-03-06 12:58:41 +08:00
|
|
|
<SafeAreaProvider>
|
2026-03-05 18:02:54 +08:00
|
|
|
<StatusBar style="dark" />
|
2026-03-10 19:04:18 +08:00
|
|
|
<View style={{ flex: 1 }}>
|
2026-03-13 21:52:09 +08:00
|
|
|
<Stack screenOptions={{ headerShown: false }}>
|
|
|
|
|
<Stack.Screen name="index" />
|
|
|
|
|
<Stack.Screen
|
|
|
|
|
name="video"
|
|
|
|
|
options={{
|
|
|
|
|
animation: "slide_from_right",
|
|
|
|
|
gestureEnabled: true,
|
|
|
|
|
gestureDirection: "horizontal",
|
|
|
|
|
}}
|
|
|
|
|
/>
|
2026-03-16 16:20:59 +08:00
|
|
|
<Stack.Screen
|
|
|
|
|
name="live"
|
|
|
|
|
options={{
|
|
|
|
|
animation: "slide_from_right",
|
|
|
|
|
gestureEnabled: true,
|
|
|
|
|
gestureDirection: "horizontal",
|
|
|
|
|
}}
|
|
|
|
|
/>
|
2026-03-16 21:13:26 +08:00
|
|
|
<Stack.Screen
|
|
|
|
|
name="search"
|
|
|
|
|
options={{
|
|
|
|
|
animation: "slide_from_right",
|
|
|
|
|
gestureEnabled: true,
|
|
|
|
|
}}
|
|
|
|
|
/>
|
2026-03-17 22:18:05 +08:00
|
|
|
<Stack.Screen
|
|
|
|
|
name="downloads"
|
|
|
|
|
options={{
|
|
|
|
|
animation: "slide_from_right",
|
|
|
|
|
gestureEnabled: true,
|
|
|
|
|
gestureDirection: "horizontal",
|
|
|
|
|
}}
|
|
|
|
|
/>
|
2026-03-19 16:34:56 +08:00
|
|
|
<Stack.Screen
|
|
|
|
|
name="settings"
|
|
|
|
|
options={{
|
|
|
|
|
animation: "slide_from_right",
|
|
|
|
|
gestureEnabled: true,
|
|
|
|
|
gestureDirection: "horizontal",
|
|
|
|
|
}}
|
|
|
|
|
/>
|
2026-03-13 21:52:09 +08:00
|
|
|
</Stack>
|
2026-03-10 19:04:18 +08:00
|
|
|
<MiniPlayer />
|
|
|
|
|
</View>
|
2026-03-06 12:58:41 +08:00
|
|
|
</SafeAreaProvider>
|
2026-03-05 18:02:54 +08:00
|
|
|
);
|
|
|
|
|
}
|