Files
LocalMind/app/_layout.tsx
T
evandro e08189f640 wip: snapshot das alterações não commitadas (2026-10-20)
Origem: D:/Documents/Github/LocalAiApp
Arquivos omitidos (segredos, bancos de dados, logs, >50 MB): 0
2026-10-20 00:48:09 -03:00

38 lines
1.3 KiB
TypeScript

import { DarkTheme, DefaultTheme, ThemeProvider } from '@react-navigation/native';
import { Stack } from 'expo-router';
import * as SplashScreen from 'expo-splash-screen';
import { StatusBar } from 'expo-status-bar';
import { useEffect } from 'react';
import 'react-native-reanimated';
import { useColorScheme } from '@/hooks/useColorScheme';
import { useAppStore } from '@/store/useAppStore';
// Prevent the splash screen from auto-hiding before asset loading is complete.
SplashScreen.preventAutoHideAsync();
export default function RootLayout() {
const systemColorScheme = useColorScheme();
const themePreference = useAppStore((state) => state.theme);
useEffect(() => {
SplashScreen.hideAsync();
}, []);
const isDark = themePreference === 'system'
? systemColorScheme === 'dark'
: themePreference === 'dark';
return (
<ThemeProvider value={isDark ? DarkTheme : DefaultTheme}>
<Stack>
<Stack.Screen name="index" options={{ headerShown: false }} />
<Stack.Screen name="chat" options={{ headerShown: false }} />
<Stack.Screen name="settings/index" options={{ presentation: 'modal', title: 'Settings' }} />
<Stack.Screen name="+not-found" />
</Stack>
<StatusBar style={isDark ? 'light' : 'dark'} />
</ThemeProvider>
);
}