2024-07-04 17:29:47 +02:00
|
|
|
import 'react-native-reanimated';
|
|
|
|
import 'react-native-gesture-handler';
|
2024-06-26 04:20:08 +02:00
|
|
|
import { DarkTheme, DefaultTheme, ThemeProvider } from '@react-navigation/native';
|
|
|
|
import { useFonts } from 'expo-font';
|
|
|
|
import { Stack } from 'expo-router';
|
|
|
|
import * as SplashScreen from 'expo-splash-screen';
|
|
|
|
import { useEffect } from 'react';
|
|
|
|
|
|
|
|
import { useColorScheme } from '@/hooks/useColorScheme';
|
|
|
|
|
|
|
|
// Prevent the splash screen from auto-hiding before asset loading is complete.
|
|
|
|
SplashScreen.preventAutoHideAsync();
|
|
|
|
|
|
|
|
export default function RootLayout() {
|
|
|
|
const colorScheme = useColorScheme();
|
|
|
|
const [loaded] = useFonts({
|
|
|
|
SpaceMono: require('../assets/fonts/SpaceMono-Regular.ttf'),
|
|
|
|
});
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
if (loaded) {
|
|
|
|
SplashScreen.hideAsync();
|
|
|
|
}
|
|
|
|
}, [loaded]);
|
|
|
|
|
|
|
|
if (!loaded) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2024-07-04 17:29:47 +02:00
|
|
|
// return (
|
|
|
|
// <View>
|
|
|
|
// <Text>Hello World!</Text>
|
|
|
|
// </View>
|
|
|
|
// )
|
|
|
|
|
2024-06-26 04:20:08 +02:00
|
|
|
return (
|
|
|
|
<ThemeProvider value={colorScheme === 'dark' ? DarkTheme : DefaultTheme}>
|
|
|
|
<Stack>
|
|
|
|
<Stack.Screen name="(tabs)" options={{ headerShown: false }} />
|
|
|
|
<Stack.Screen name="+not-found" />
|
|
|
|
</Stack>
|
|
|
|
</ThemeProvider>
|
|
|
|
);
|
|
|
|
}
|