Files
JKVideo/app/_layout.tsx
Developer 829d175baa 1
2026-03-16 16:20:59 +08:00

44 lines
1.2 KiB
TypeScript

import { Stack } from 'expo-router';
import { StatusBar } from 'expo-status-bar';
import { SafeAreaProvider } from 'react-native-safe-area-context';
import { View } from 'react-native';
import { useEffect } from 'react';
import { useAuthStore } from '../store/authStore';
import { MiniPlayer } from '../components/MiniPlayer';
export default function RootLayout() {
const restore = useAuthStore(s => s.restore);
useEffect(() => {
restore();
}, []);
return (
<SafeAreaProvider>
<StatusBar style="dark" />
<View style={{ flex: 1 }}>
<Stack screenOptions={{ headerShown: false }}>
<Stack.Screen name="index" />
<Stack.Screen
name="video"
options={{
animation: "slide_from_right",
gestureEnabled: true,
gestureDirection: "horizontal",
}}
/>
<Stack.Screen
name="live"
options={{
animation: "slide_from_right",
gestureEnabled: true,
gestureDirection: "horizontal",
}}
/>
</Stack>
<MiniPlayer />
</View>
</SafeAreaProvider>
);
}