selection chantier (animation,correction) ; ajustement et amélioration du thème ; chantier provider
This commit is contained in:
@@ -13,6 +13,10 @@ import { useRouter } from "expo-router";
|
||||
import { useColorScheme } from "@/hooks/use-color-scheme";
|
||||
import { doc, getDoc } from "firebase/firestore";
|
||||
|
||||
import { UIManager, Platform } from 'react-native';
|
||||
import { ChantierProvider } from "./Context";
|
||||
|
||||
|
||||
export const unstable_settings = {
|
||||
anchor: "(tabs)",
|
||||
};
|
||||
@@ -23,6 +27,14 @@ export default function RootLayout() {
|
||||
const [user, setUser] = useState<User | null>(null);
|
||||
const [userRole, setUserRole] = useState<string | null>(null);
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
if (Platform.OS === 'android' && UIManager.setLayoutAnimationEnabledExperimental) {
|
||||
UIManager.setLayoutAnimationEnabledExperimental(true);
|
||||
}
|
||||
}, []);
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
const unsubscribe = onAuthStateChanged(auth, async (currentUser) => {
|
||||
setUser(currentUser);
|
||||
@@ -56,18 +68,19 @@ export default function RootLayout() {
|
||||
}, []);
|
||||
|
||||
return (
|
||||
|
||||
<ThemeProvider value={colorScheme === "dark" ? DarkTheme : DefaultTheme}>
|
||||
<Stack>
|
||||
<Stack.Screen name="(tabs)" options={{ headerShown: false }} />
|
||||
<Stack.Screen name="selectChantier" options={{ headerShown: false }}/>
|
||||
<Stack.Screen
|
||||
name="modal"
|
||||
options={{ presentation: "modal", title: "Modal" }}
|
||||
/>
|
||||
<Stack.Screen name="login" options={{ headerShown: false }} />
|
||||
</Stack>
|
||||
<StatusBar style="auto" />
|
||||
</ThemeProvider>
|
||||
<ChantierProvider>
|
||||
<ThemeProvider value={colorScheme === "dark" ? DarkTheme : DefaultTheme}>
|
||||
<Stack>
|
||||
<Stack.Screen name="(tabs)" options={{ headerShown: false }} />
|
||||
<Stack.Screen name="selectChantier" options={{ headerShown: false }}/>
|
||||
<Stack.Screen
|
||||
name="modal"
|
||||
options={{ presentation: "modal", title: "Modal" }}
|
||||
/>
|
||||
<Stack.Screen name="login" options={{ headerShown: false }} />
|
||||
</Stack>
|
||||
<StatusBar style="auto" />
|
||||
</ThemeProvider>
|
||||
</ChantierProvider>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user