Commit 414a9c06 authored by Lorenzo Trujillo Rojas's avatar Lorenzo Trujillo Rojas
Browse files

cambios varios

parent c5f1d77d
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
{
  "folders": [
	{
		"name": "backend",
		"path": "."
	}
],
  "settings": {}
}
+10 −6
Original line number Diff line number Diff line
@@ -7,16 +7,20 @@ import { useTranslation } from "react-i18next";
import { useSetUp } from "../../src/common/contexts/set_up_context";

export default function Layout() {
  const { user } = useAuth();
  const { user, isVerified } = useAuth();
  const { isFirstTime } = useSetUp();
  const LANG = useTranslation();
  console.log(user);

  if (!user) {
    return <Redirect href={'/login'}/>;
    return <Redirect href={"/login"} />;
  }

  if (!isVerified) {
    return <Redirect href={"/verify"} />;
  }

  if (isFirstTime) {
    return <Redirect href={'/profile/set_up'}/>;
    return <Redirect href={"/profile/set_up"} />;
  }

  return (
+22 −3
Original line number Diff line number Diff line
@@ -8,9 +8,12 @@ import {
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 { I18nextProvider, useTranslation } from "react-i18next";
import i18n from "../src/lang/translations";
import { SetUpContextProvider, useSetUp } from "../src/common/contexts/set_up_context";
import {
  SetUpContextProvider,
  useSetUp,
} from "../src/common/contexts/set_up_context";

export default function Root() {
  return (
@@ -32,6 +35,7 @@ export default function Root() {

const MainLayout = () => {
  const { isLoading } = useAuth();
  const { t } = useTranslation();

  if (isLoading) {
    return <ActivityIndicator />;
@@ -76,7 +80,7 @@ const MainLayout = () => {
      <Stack.Screen
        name="scan"
        options={{
          title: "Scan",
          title: t("scanScreen.title"),
          statusBarColor: LIGHT_THEME.color.primary,
          headerStyle: {
            backgroundColor: LIGHT_THEME.color.primary,
@@ -117,6 +121,21 @@ const MainLayout = () => {
          statusBarColor: LIGHT_THEME.color.primary,
        }}
      />
      <Stack.Screen
        name="routes/generate_route_form"
        options={{
          title: t("generateRouteScreen.title"),
          statusBarColor: LIGHT_THEME.color.primary,
          headerStyle: {
            backgroundColor: LIGHT_THEME.color.primary,
          },
          headerTitleStyle: {
            color: LIGHT_THEME.color.white,
          },
          headerTitleAlign: "center",
          headerTintColor: LIGHT_THEME.color.white,
        }}
      />
      <Stack.Screen
        name="auth/reset_password"
        options={{
+27 −19
Original line number Diff line number Diff line
import { Stack } from "expo-router";
import { LIGHT_THEME } from "../../../../src/common/const/theme";
import { useTranslation } from "react-i18next";

export default function Layout() {
  const { t } = useTranslation();
  return (
    <Stack>
            <Stack.Screen name="[townId]/index" options={{
                title: "Select an activity",
      <Stack.Screen
        name="[townId]/index"
        options={{
          title: t("selectTownActivityScreen.title"),
          headerStyle: {
            backgroundColor: LIGHT_THEME.color.primary,
          },
@@ -14,10 +18,14 @@ export default function Layout() {
          },
          headerTitleAlign: "center",
          headerTintColor: LIGHT_THEME.color.white,
            }}/>
            <Stack.Screen name="[townId]/activity" options={{
                headerShown: false
            }}/>
        }}
      />
      <Stack.Screen
        name="[townId]/activity"
        options={{
          headerShown: false,
        }}
      />
    </Stack>
  );
}
+3 −1
Original line number Diff line number Diff line
import { Stack } from "expo-router";
import { LIGHT_THEME } from "../../src/common/const/theme";
import { useTranslation } from "react-i18next";

export default function Layout() {
  const { t } = useTranslation();
  return (
    <Stack>
      <Stack.Screen
        name="[stateId]/index"
        options={{
          title: "Select a town",
          title: t("selectTownScreen.title"),
          headerStyle: {
            backgroundColor: LIGHT_THEME.color.primary,
          },
Loading