Commit 150637f1 authored by Lorenzo Trujillo Rojas's avatar Lorenzo Trujillo Rojas
Browse files

Se agregó multilenguaje al contexto de la aplicación

parent ecb654c1
Loading
Loading
Loading
Loading
+41 −25
Original line number Diff line number Diff line
import { Stack, Tabs } from "expo-router";
import { DataContextProvider } from "../src/common/contexts/data_context";
import { LIGTHT_THEME } from "../src/common/constants/theme";
import { AuthContextProvider, useAuth } from "../src/auth/contexts/auth_context";
import { LIGHT_THEME } from "../src/common/constants/theme";
import {
  AuthContextProvider,
  useAuth,
} from "../src/auth/contexts/auth_context";
import { ActivityIndicator } from "react-native";
import { GestureHandlerRootView } from "react-native-gesture-handler";
import { AudioContextProvider } from "../src/common/contexts/audio_context";
import { I18nextProvider } from "react-i18next";
import i18n from "../src/lang/translations";
import { SetUpContextProvider, useSetUp } from "../src/common/contexts/set_up_context";

export default function Root() {
  return (
    <I18nextProvider i18n={i18n}>
      <GestureHandlerRootView style={{ flex: 1 }}>
        <DataContextProvider>
          <AuthContextProvider>
            <AudioContextProvider>
              <SetUpContextProvider>
                <MainLayout />
              </SetUpContextProvider>
            </AudioContextProvider>
          </AuthContextProvider>
        </DataContextProvider>
      </GestureHandlerRootView>
    </I18nextProvider>
  );
}

@@ -33,14 +43,14 @@ const MainLayout = () => {
        name="(tabs)"
        options={{
          headerShown: false,
          statusBarColor: LIGTHT_THEME.color.primary,
          statusBarColor: LIGHT_THEME.color.primary,
        }}
      />
      <Stack.Screen
        name="state"
        options={{
          headerShown: false,
          statusBarColor: LIGTHT_THEME.color.primary,
          statusBarColor: LIGHT_THEME.color.primary,
        }}
      />
      <Stack.Screen
@@ -67,25 +77,31 @@ const MainLayout = () => {
        name="scan"
        options={{
          title: "Scan",
          statusBarColor: LIGTHT_THEME.color.primary,
          statusBarColor: LIGHT_THEME.color.primary,
          headerStyle: {
            backgroundColor: LIGTHT_THEME.color.primary,
            backgroundColor: LIGHT_THEME.color.primary,
          },
          headerTitleStyle: {
            color: LIGTHT_THEME.color.white,
            color: LIGHT_THEME.color.white,
          },
          headerTitleAlign: "center",
          headerTintColor: LIGTHT_THEME.color.white,
          headerTintColor: LIGHT_THEME.color.white,
        }}
      />
      <Stack.Screen name="travel_history" options={{
      <Stack.Screen
        name="travel_history"
        options={{
          headerShown: false,
        statusBarColor: LIGTHT_THEME.color.primary,
      }}/>
      <Stack.Screen name="routes/generate_route" options={{
          statusBarColor: LIGHT_THEME.color.primary,
        }}
      />
      <Stack.Screen
        name="routes/generate_route"
        options={{
          headerShown: false,
        statusBarColor: LIGTHT_THEME.color.primary,
      }}/>
          statusBarColor: LIGHT_THEME.color.primary,
        }}
      />
    </Stack>
  );
};