29 lines
1.1 KiB
TypeScript
29 lines
1.1 KiB
TypeScript
import { DarkTheme, DefaultTheme, ThemeProvider } from '@react-navigation/native'
|
|
import { Stack } from "expo-router"
|
|
import { useColorScheme } from '@/hooks/useColorScheme'
|
|
import { StatusBar } from 'expo-status-bar'
|
|
import { Provider as StoreProvider } from 'react-redux'
|
|
import { MD3DarkTheme, MD3LightTheme, PaperProvider } from 'react-native-paper'
|
|
import store from '@/utils/store'
|
|
import { useStartGeolocationServiceEffect } from '@/utils/geolocation'
|
|
|
|
export default function RootLayout() {
|
|
useStartGeolocationServiceEffect()
|
|
const colorScheme = useColorScheme()
|
|
|
|
return (
|
|
<StoreProvider store={store}>
|
|
<PaperProvider theme={colorScheme === 'dark' ? MD3DarkTheme : MD3LightTheme}>
|
|
<ThemeProvider value={colorScheme === 'dark' ? DarkTheme : DefaultTheme}>
|
|
<Stack>
|
|
<Stack.Screen name="(tabs)" options={{ headerShown: false }} />
|
|
<Stack.Screen name="login" options={{ title: "Connexion" }} />
|
|
<Stack.Screen name="+not-found" />
|
|
</Stack>
|
|
<StatusBar style="auto" />
|
|
</ThemeProvider>
|
|
</PaperProvider>
|
|
</StoreProvider>
|
|
)
|
|
}
|