| 1 | import {
|
| 2 | DarkTheme,
|
| 3 | DefaultTheme,
|
| 4 | Stack,
|
| 5 | ThemeProvider,
|
| 6 | } from "expo-router";
|
| 7 | import { useColorScheme } from "react-native";
|
| 8 | import { QueryClientProvider } from "@tanstack/react-query";
|
| 9 | import { queryClient } from "@/lib/queryClient";
|
| 10 | import { useNotificationObserver } from "@/hooks/useNotificationObserver";
|
| 11 | import { AuthProvider } from "@/context/AuthContext";
|
| 12 | import { ToastProvider } from "@/context/ToastContext";
|
| 13 |
|
| 14 | export const unstable_settings = {
|
| 15 | initialRouteName: "(tabs)",
|
| 16 | };
|
| 17 |
|
| 18 | const AppBootstrap = () => {
|
| 19 | useNotificationObserver();
|
| 20 | return null;
|
| 21 | };
|
| 22 |
|
| 23 | export default function RootLayout() {
|
| 24 | const colorScheme = useColorScheme();
|
| 25 |
|
| 26 | return (
|
| 27 | <QueryClientProvider client={queryClient}>
|
| 28 | <ThemeProvider value={DefaultTheme}>
|
| 29 | <ToastProvider>
|
| 30 | <AuthProvider>
|
| 31 | <AppBootstrap />
|
| 32 | <Stack>
|
| 33 | <Stack.Screen name="index" options={{ headerShown: false }} />
|
| 34 | <Stack.Screen name="(tabs)" options={{ headerShown: false }} />
|
| 35 | <Stack.Screen
|
| 36 | name="auth"
|
| 37 | options={{
|
| 38 | headerShown: false,
|
| 39 | presentation: "modal",
|
| 40 | }}
|
| 41 | />
|
| 42 |
|
| 43 | <Stack.Screen
|
| 44 | name="profile"
|
| 45 | options={{
|
| 46 | title: "Editar perfil",
|
| 47 | }}
|
| 48 | />
|
| 49 |
|
| 50 | <Stack.Screen
|
| 51 | name="entry/mood-components"
|
| 52 | options={{
|
| 53 | presentation: "formSheet",
|
| 54 | title: "Editar Componentes",
|
| 55 | sheetAllowedDetents: [0.25, 0.5, 1],
|
| 56 | sheetInitialDetentIndex: 1,
|
| 57 | }}
|
| 58 | />
|
| 59 |
|
| 60 | <Stack.Screen
|
| 61 | name="care-actions/post-appointment"
|
| 62 | options={{ headerShown: false }}
|
| 63 | />
|
| 64 |
|
| 65 | <Stack.Screen
|
| 66 | name="sleep/new"
|
| 67 | options={{
|
| 68 | title: "Registrar Sono",
|
| 69 | }}
|
| 70 | />
|
| 71 |
|
| 72 | <Stack.Screen
|
| 73 | name="triggers/new"
|
| 74 | options={{
|
| 75 | title: "Registrar Gatilho",
|
| 76 | }}
|
| 77 | />
|
| 78 |
|
| 79 | <Stack.Screen
|
| 80 | name="care-actions/new"
|
| 81 | options={{
|
| 82 | presentation: "formSheet",
|
| 83 | title: "Registrar Ação de Cuidado",
|
| 84 | sheetAllowedDetents: [0.25, 0.5, 0.7],
|
| 85 | sheetInitialDetentIndex: 1,
|
| 86 | }}
|
| 87 | />
|
| 88 | <Stack.Screen
|
| 89 | name="care-actions/medicine"
|
| 90 | options={{ title: "Medicamento" }}
|
| 91 | />
|
| 92 | <Stack.Screen
|
| 93 | name="care-actions/medicine-new"
|
| 94 | options={{ title: "Novo Medicamento" }}
|
| 95 | />
|
| 96 | <Stack.Screen
|
| 97 | name="care-actions/appointment"
|
| 98 | options={{ title: "Consulta" }}
|
| 99 | />
|
| 100 | <Stack.Screen
|
| 101 | name="care-actions/activity"
|
| 102 | options={{ title: "Atividade" }}
|
| 103 | />
|
| 104 |
|
| 105 | <Stack.Screen
|
| 106 | name="medicine-regimens/index"
|
| 107 | options={{ title: "Gerenciar Medicamentos" }}
|
| 108 | />
|
| 109 |
|
| 110 | <Stack.Screen
|
| 111 | name="notifications"
|
| 112 | options={{
|
| 113 | presentation: "modal",
|
| 114 | title: "Notificações",
|
| 115 | }}
|
| 116 | />
|
| 117 |
|
| 118 | <Stack.Screen
|
| 119 | name="modal"
|
| 120 | options={{ presentation: "modal", title: "Modal" }}
|
| 121 | />
|
| 122 | </Stack>
|
| 123 | </AuthProvider>
|
| 124 | </ToastProvider>
|
| 125 | </ThemeProvider>
|
| 126 | </QueryClientProvider>
|
| 127 | );
|
| 128 | }
|