xref: /MusicFree/src/entry/index.tsx (revision a27adc201796bd0be4a6a41893461b099d480a34)
14060c00aS猫头猫import React from 'react';
2bf6e62f2S猫头猫import {NavigationContainer} from '@react-navigation/native';
3bf6e62f2S猫头猫import {createNativeStackNavigator} from '@react-navigation/native-stack';
4bf6e62f2S猫头猫import bootstrap from './bootstrap';
5e7fa3837S猫头猫import {routes} from './router';
6bf6e62f2S猫头猫import {GestureHandlerRootView} from 'react-native-gesture-handler';
7bf6e62f2S猫头猫import Dialogs from '@/components/dialogs';
8bf6e62f2S猫头猫import Toast from 'react-native-toast-message';
9bf6e62f2S猫头猫import Panels from '@/components/panels';
1019dc08ecS猫头猫import PageBackground from '@/components/base/pageBackground';
111c06c799S猫头猫import {SafeAreaProvider} from 'react-native-safe-area-context';
122a3194f5S猫头猫import toastConfig from '@/components/base/toast';
13cf2d630eS猫头猫import useBootstrap from './useBootstrap';
14ea6d708fS猫头猫import Debug from '@/components/debug';
15a33ab089S猫头猫import {ImageViewComponent} from '@/components/imageViewer';
167a8d024eS猫头猫import {PortalHost} from '@/components/base/portal';
176cfecf1cS猫头猫import globalStyle from '@/constants/globalStyle';
18*a27adc20S猫头猫import Theme from '@/core/theme';
19bf6e62f2S猫头猫
20bf6e62f2S猫头猫/**
21bf6e62f2S猫头猫 * 字体颜色
22bf6e62f2S猫头猫 */
23bf6e62f2S猫头猫
24bf6e62f2S猫头猫bootstrap();
25e7fa3837S猫头猫const Stack = createNativeStackNavigator<any>();
26bf6e62f2S猫头猫
27bf6e62f2S猫头猫export default function Pages() {
28*a27adc20S猫头猫    const theme = Theme.useTheme();
29cf2d630eS猫头猫    useBootstrap();
30cf2d630eS猫头猫
31bf6e62f2S猫头猫    return (
326cfecf1cS猫头猫        <GestureHandlerRootView style={globalStyle.flex1}>
331c06c799S猫头猫            <SafeAreaProvider>
34*a27adc20S猫头猫                <NavigationContainer theme={theme}>
354060c00aS猫头猫                    <PageBackground />
36bf6e62f2S猫头猫                    <Stack.Navigator
37bf6e62f2S猫头猫                        initialRouteName={routes[0].path}
38bf6e62f2S猫头猫                        screenOptions={{
39bf6e62f2S猫头猫                            statusBarColor: 'transparent',
40bf6e62f2S猫头猫                            statusBarTranslucent: true,
41bf6e62f2S猫头猫                            headerShown: false,
42bf6e62f2S猫头猫                            animation: 'slide_from_right',
435f52c604S猫头猫                            animationDuration: 100,
44bf6e62f2S猫头猫                        }}>
45bf6e62f2S猫头猫                        {routes.map(route => (
46bf6e62f2S猫头猫                            <Stack.Screen
47bf6e62f2S猫头猫                                key={route.path}
48bf6e62f2S猫头猫                                name={route.path}
494060c00aS猫头猫                                component={route.component}
504060c00aS猫头猫                            />
51bf6e62f2S猫头猫                        ))}
52bf6e62f2S猫头猫                    </Stack.Navigator>
53bf6e62f2S猫头猫
544060c00aS猫头猫                    <Panels />
554060c00aS猫头猫                    <Dialogs />
56a33ab089S猫头猫                    <ImageViewComponent />
572a3194f5S猫头猫                    <Toast config={toastConfig} />
58ea6d708fS猫头猫                    <Debug />
597a8d024eS猫头猫                    <PortalHost />
60bf6e62f2S猫头猫                </NavigationContainer>
611c06c799S猫头猫            </SafeAreaProvider>
62bf6e62f2S猫头猫        </GestureHandlerRootView>
63bf6e62f2S猫头猫    );
64bf6e62f2S猫头猫}
65