diff options
author | polwex <polwex@sortug.com> | 2025-07-15 17:20:58 +0700 |
---|---|---|
committer | polwex <polwex@sortug.com> | 2025-07-15 17:20:58 +0700 |
commit | a528bd94a6e8e25010ae26a305550b211df0ddc6 (patch) | |
tree | 887425ddc3160ae023292dfefc49d77c2eb8dcec /app/_layout.tsx |
Initial commit
Generated by create-expo 3.4.3.
Diffstat (limited to 'app/_layout.tsx')
-rw-r--r-- | app/_layout.tsx | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/app/_layout.tsx b/app/_layout.tsx new file mode 100644 index 0000000..8d506f7 --- /dev/null +++ b/app/_layout.tsx @@ -0,0 +1,29 @@ +import { DarkTheme, DefaultTheme, ThemeProvider } from '@react-navigation/native'; +import { useFonts } from 'expo-font'; +import { Stack } from 'expo-router'; +import { StatusBar } from 'expo-status-bar'; +import 'react-native-reanimated'; + +import { useColorScheme } from '@/hooks/useColorScheme'; + +export default function RootLayout() { + const colorScheme = useColorScheme(); + const [loaded] = useFonts({ + SpaceMono: require('../assets/fonts/SpaceMono-Regular.ttf'), + }); + + if (!loaded) { + // Async font loading only occurs in development. + return null; + } + + return ( + <ThemeProvider value={colorScheme === 'dark' ? DarkTheme : DefaultTheme}> + <Stack> + <Stack.Screen name="(tabs)" options={{ headerShown: false }} /> + <Stack.Screen name="+not-found" /> + </Stack> + <StatusBar style="auto" /> + </ThemeProvider> + ); +} |