1bf6e62f2S猫头猫import React from 'react'; 2bf6e62f2S猫头猫import {Image, StyleSheet} from 'react-native'; 3bf6e62f2S猫头猫 4bf6e62f2S猫头猫import {NavigationContainer} from '@react-navigation/native'; 5bf6e62f2S猫头猫import {createNativeStackNavigator} from '@react-navigation/native-stack'; 6bf6e62f2S猫头猫import bootstrap from './bootstrap'; 7bf6e62f2S猫头猫import {routes} from './router'; 8bf6e62f2S猫头猫import {Provider as PaperProvider} from 'react-native-paper'; 9bf6e62f2S猫头猫import {GestureHandlerRootView} from 'react-native-gesture-handler'; 10bf6e62f2S猫头猫import Dialogs from '@/components/dialogs'; 11bf6e62f2S猫头猫import Toast from 'react-native-toast-message'; 12bf6e62f2S猫头猫import Panels from '@/components/panels'; 13bf6e62f2S猫头猫import {CustomTheme, DarkTheme, DefaultTheme} from './theme'; 14bf6e62f2S猫头猫import {useConfig} from '@/common/localConfigManager'; 15*d1f226e6S猫头猫import Share from '@/components/share'; 16bf6e62f2S猫头猫 17bf6e62f2S猫头猫// todo: load config 18bf6e62f2S猫头猫/** 19bf6e62f2S猫头猫 * 字体颜色 20bf6e62f2S猫头猫 */ 21bf6e62f2S猫头猫 22bf6e62f2S猫头猫bootstrap(); 23bf6e62f2S猫头猫const Stack = createNativeStackNavigator(); 24bf6e62f2S猫头猫 25bf6e62f2S猫头猫export default function Pages() { 26a92b50b7S猫头猫 const background = useConfig('setting.theme.background'); 27a92b50b7S猫头猫 const theme = useConfig('setting.theme.mode') ?? 'dark'; 28bf6e62f2S猫头猫 29bf6e62f2S猫头猫 return ( 30bf6e62f2S猫头猫 <GestureHandlerRootView style={{flex: 1}}> 31a92b50b7S猫头猫 <PaperProvider theme={theme === 'dark'? CustomTheme : DefaultTheme}> 32a92b50b7S猫头猫 <NavigationContainer theme={theme === 'dark'? CustomTheme : DefaultTheme}> 33bf6e62f2S猫头猫 <Image 34bf6e62f2S猫头猫 style={style.blur} 35bf6e62f2S猫头猫 blurRadius={15} 36bf6e62f2S猫头猫 source={ 37c459c0a6S猫头猫 background 38bf6e62f2S猫头猫 ? { 39c459c0a6S猫头猫 uri: background, 40bf6e62f2S猫头猫 } 41bf6e62f2S猫头猫 : require('@/assets/imgs/background.jpg') 42bf6e62f2S猫头猫 }></Image> 43bf6e62f2S猫头猫 44bf6e62f2S猫头猫 <Stack.Navigator 45bf6e62f2S猫头猫 initialRouteName={routes[0].path} 46bf6e62f2S猫头猫 screenOptions={{ 47bf6e62f2S猫头猫 statusBarColor: 'transparent', 48bf6e62f2S猫头猫 statusBarTranslucent: true, 49bf6e62f2S猫头猫 headerShown: false, 50bf6e62f2S猫头猫 animation: 'slide_from_right', 51bf6e62f2S猫头猫 animationDuration: 200, 52bf6e62f2S猫头猫 }}> 53bf6e62f2S猫头猫 {routes.map(route => ( 54bf6e62f2S猫头猫 <Stack.Screen 55bf6e62f2S猫头猫 key={route.path} 56bf6e62f2S猫头猫 name={route.path} 57bf6e62f2S猫头猫 component={route.component}></Stack.Screen> 58bf6e62f2S猫头猫 ))} 59bf6e62f2S猫头猫 </Stack.Navigator> 60bf6e62f2S猫头猫 61bf6e62f2S猫头猫 <Panels></Panels> 62bf6e62f2S猫头猫 <Dialogs></Dialogs> 63*d1f226e6S猫头猫 <Share></Share> 64bf6e62f2S猫头猫 <Toast></Toast> 65bf6e62f2S猫头猫 </NavigationContainer> 66bf6e62f2S猫头猫 </PaperProvider> 67bf6e62f2S猫头猫 </GestureHandlerRootView> 68bf6e62f2S猫头猫 ); 69bf6e62f2S猫头猫} 70bf6e62f2S猫头猫 71bf6e62f2S猫头猫const style = StyleSheet.create({ 72bf6e62f2S猫头猫 blur: { 73bf6e62f2S猫头猫 width: '100%', 74bf6e62f2S猫头猫 height: '100%', 75bf6e62f2S猫头猫 position: 'absolute', 76bf6e62f2S猫头猫 top: 0, 77bf6e62f2S猫头猫 left: 0, 78bf6e62f2S猫头猫 right: 0, 79bf6e62f2S猫头猫 bottom: 0, 80bf6e62f2S猫头猫 }, 81bf6e62f2S猫头猫}); 82