diff --git a/app/(auth)/(tabs)/_layout.tsx b/app/(auth)/(tabs)/_layout.tsx deleted file mode 100644 index 65db960..0000000 --- a/app/(auth)/(tabs)/_layout.tsx +++ /dev/null @@ -1,46 +0,0 @@ -import React from "react"; -import FontAwesome from "@expo/vector-icons/FontAwesome"; -import { Link, Tabs } from "expo-router"; -import { Pressable } from "react-native"; - -// You can explore the built-in icon families and icons on the web at https://icons.expo.fyi/ -function TabBarIcon(props: { - name: React.ComponentProps["name"]; - color: string; -}) { - return ; -} - -export default function TabLayout() { - return ( - - , - headerRight: () => ( - - - {({ pressed }) => ( - - )} - - - ), - }} - /> - , - }} - /> - - ); -} diff --git a/app/(auth)/(tabs)/index.tsx b/app/(auth)/(tabs)/index.tsx deleted file mode 100644 index be20dce..0000000 --- a/app/(auth)/(tabs)/index.tsx +++ /dev/null @@ -1,40 +0,0 @@ -import { Button, StyleSheet } from "react-native"; - -import { Text } from "@/components/ui/text"; -import { View } from "react-native"; -import { useSession } from "@/ctx"; - -export default function TabOneScreen() { - const { signOut, session } = useSession(); - return ( - - Tab One - Welcome, {session} - - - - ))} - - - - ); -} diff --git a/app/(auth)/(tabs)/two.tsx b/app/(auth)/(tabs)/two.tsx deleted file mode 100644 index 9bc2208..0000000 --- a/app/(auth)/(tabs)/two.tsx +++ /dev/null @@ -1,30 +0,0 @@ -import { StyleSheet } from "react-native"; - -import { Text } from "@/components/ui/text"; -import { View } from "react-native"; - -export default function TabTwoScreen() { - return ( - - Tab Two - - - ); -} - -const styles = StyleSheet.create({ - container: { - flex: 1, - alignItems: "center", - justifyContent: "center", - }, - title: { - fontSize: 20, - fontWeight: "bold", - }, - separator: { - marginVertical: 30, - height: 1, - width: "80%", - }, -}); diff --git a/app/(auth)/_layout.tsx b/app/(auth)/_layout.tsx index c70eb7d..483ed8c 100644 --- a/app/(auth)/_layout.tsx +++ b/app/(auth)/_layout.tsx @@ -1,25 +1,15 @@ -import { Redirect, Stack } from "expo-router"; +import { Slot, Stack} from "expo-router"; -import { useSession } from "@/ctx"; -import { Text } from "@/components/ui/text"; +import {SafeAreaView, View} from "react-native"; -export default function AppLayout() { - const { session, isLoading } = useSession(); - // You can keep the splash screen open, or render a loading screen like we do here. - if (isLoading) { - return Loading...; - } +export default function AuthLayout() { - // Only require authentication within the (app) group's layout as users - // need to be able to access the (auth) group and sign in again. - if (!session) { - return ; - } - - return ( - - - - - ); + return ( + + + + + + + ); } diff --git a/app/(auth)/(tabs)/code-send.tsx b/app/(auth)/code-send.tsx similarity index 74% rename from app/(auth)/(tabs)/code-send.tsx rename to app/(auth)/code-send.tsx index 306cdc9..569e345 100644 --- a/app/(auth)/(tabs)/code-send.tsx +++ b/app/(auth)/code-send.tsx @@ -1,13 +1,13 @@ -import BackButton from "../../../components/BackButton"; +import BackButton from "@/components/BackButton"; import React from "react"; -import { Card } from "../../../components/ui/card"; -import Screen from "../../../components/Screen"; -import { Heading } from "../../../components/ui/heading"; +import { Card } from "@/components/ui/card"; +import Screen from "@/components/Screen"; +import { Heading } from "@/components/ui/heading"; import { AntDesign } from "@expo/vector-icons"; -import { VStack } from "../../../components/ui/vstack"; -import { Text } from "../../../components/ui/text"; -import { Button, ButtonIcon, ButtonText } from "../../../components/ui/button"; -import { LockIcon } from "../../../components/ui/icon"; +import { VStack } from "@/components/ui/vstack"; +import { Text } from "@/components/ui/text"; +import { Button, ButtonIcon, ButtonText } from "@/components/ui/button"; +import { LockIcon } from "@/components/ui/icon"; function truncateEmail(email: string) { const splitedEmail = email.split("@"); @@ -23,7 +23,7 @@ type props = { email?: string }; export default function CodeSentPage({ email }: props) { return ( - + Inscris-toi ! - + Mot de passe oublié ? diff --git a/app/(auth)/modal.tsx b/app/(auth)/modal.tsx deleted file mode 100644 index 3693412..0000000 --- a/app/(auth)/modal.tsx +++ /dev/null @@ -1,34 +0,0 @@ -import { StatusBar } from "expo-status-bar"; -import { Platform, StyleSheet } from "react-native"; - -import { Text } from "@/components/ui/text"; -import { View } from "react-native"; - -export default function ModalScreen() { - return ( - - Modal - - - {/* Use a light status bar on iOS to account for the black space above the modal */} - - - ); -} - -const styles = StyleSheet.create({ - container: { - flex: 1, - alignItems: "center", - justifyContent: "center", - }, - title: { - fontSize: 20, - fontWeight: "bold", - }, - separator: { - marginVertical: 30, - height: 1, - width: "80%", - }, -}); diff --git a/app/(auth)/reset-password.tsx b/app/(auth)/reset-password.tsx new file mode 100644 index 0000000..4583625 --- /dev/null +++ b/app/(auth)/reset-password.tsx @@ -0,0 +1,67 @@ +import {Text} from "@/components/ui/text"; +import { + Button, + ButtonGroup, + ButtonIcon, + ButtonText, +} from "@/components/ui/button"; +import {VStack} from "@/components/ui/vstack"; +import React from "react"; +import { + ArrowRightIcon, + LockIcon, + MailIcon, + MessageCircleIcon, +} from "@/components/ui/icon"; +import BackButton from "@/components/BackButton"; +import Screen from "@/components/Screen"; +import {Heading} from "@/components/ui/heading"; +import {Link} from "expo-router"; +import {SafeAreaView} from "react-native"; + +const resetButtons: IResetButton[] = [ + {icon: MailIcon, text: "Envoyer par email"}, + {icon: LockIcon, text: "Envoyer par 2FA"}, + {icon: MessageCircleIcon, text: "Envoyer par SMS"}, +]; + +interface IResetButton { + icon: React.ElementType; + text: string; +} + +export default function ResetPasswordPage() { + return ( + + + + + + + Réinitialisation de ton mot de passe + + + Selectionne une méthode pour recevoir ton code temporaire + + + + {resetButtons.map((resetButton) => ( + + + + ))} + + + + + ); +} diff --git a/app/(auth)/(tabs)/sign-in.tsx b/app/(auth)/sign-in.tsx similarity index 66% rename from app/(auth)/(tabs)/sign-in.tsx rename to app/(auth)/sign-in.tsx index bb77347..a4740e2 100644 --- a/app/(auth)/(tabs)/sign-in.tsx +++ b/app/(auth)/sign-in.tsx @@ -1,13 +1,13 @@ -import { Text } from "../../../components/ui/text"; -import { VStack } from "../../../components/ui/vstack"; -import { Box } from "../../../components/ui/box"; -import { HStack } from "../../../components/ui/hstack"; +import { Text } from "@/components/ui/text"; +import { VStack } from "@/components/ui/vstack"; +import { Box } from "@/components/ui/box"; +import { HStack } from "@/components/ui/hstack"; import React from "react"; -import SigninForm from "../../../components/form/SigninForm"; -import Screen from "../../../components/Screen"; -import { Heading } from "../../../components/ui/heading"; +import SigninForm from "@/components/form/SigninForm"; +import Screen from "@/components/Screen"; +import { Heading } from "@/components/ui/heading"; import { Link } from "expo-router"; -import { LinkText } from "../../../components/ui/link"; +import { LinkText } from "@/components/ui/link"; export default function SigninPage() { return ( diff --git a/app/(profile)/_layout.tsx b/app/(profile)/_layout.tsx deleted file mode 100644 index b7092df..0000000 --- a/app/(profile)/_layout.tsx +++ /dev/null @@ -1,9 +0,0 @@ -import { Stack } from "expo-router"; - -export default function RootLayout() { - return ( - - - - ); -} diff --git a/app/(home)/_layout.tsx b/app/(tabs)/(home)/_layout.tsx similarity index 50% rename from app/(home)/_layout.tsx rename to app/(tabs)/(home)/_layout.tsx index b746538..1a29376 100644 --- a/app/(home)/_layout.tsx +++ b/app/(tabs)/(home)/_layout.tsx @@ -1,9 +1,9 @@ import { Stack } from "expo-router"; -export default function RootLayout() { +export default function RootoLayout() { return ( - + ); } diff --git a/app/(home)/home.tsx b/app/(tabs)/(home)/index.tsx similarity index 100% rename from app/(home)/home.tsx rename to app/(tabs)/(home)/index.tsx diff --git a/app/(tabs)/(profile)/_layout.tsx b/app/(tabs)/(profile)/_layout.tsx new file mode 100644 index 0000000..66fcd68 --- /dev/null +++ b/app/(tabs)/(profile)/_layout.tsx @@ -0,0 +1,9 @@ +import { Stack } from "expo-router"; + +export default function KRootLayout() { + return ( + + + + ); +} diff --git a/app/(profile)/profile.tsx b/app/(tabs)/(profile)/profile.tsx similarity index 100% rename from app/(profile)/profile.tsx rename to app/(tabs)/(profile)/profile.tsx diff --git a/app/(tabs)/_layout.tsx b/app/(tabs)/_layout.tsx new file mode 100644 index 0000000..243edf9 --- /dev/null +++ b/app/(tabs)/_layout.tsx @@ -0,0 +1,41 @@ +import {Redirect, Tabs} from "expo-router"; +import {useSession} from "@/ctx"; +import {Text} from "react-native" + +export default function TabBarLayout() { + const { session, isLoading } = useSession(); + + // You can keep the splash screen open, or render a loading screen like we do here. + if (isLoading) { + return Loading...; + } + + // Only require authentication within the (app) group's layout as users + // need to be able to access the (auth) group and sign in again. + if (!session) { + // On web, static rendering will stop here as the user is not authenticated + // in the headless Node process that the pages are rendered in. + return ; + } + return ( + + + + + ); +} diff --git a/app/+html.tsx b/app/+html.tsx deleted file mode 100644 index cb31090..0000000 --- a/app/+html.tsx +++ /dev/null @@ -1,38 +0,0 @@ -import { ScrollViewStyleReset } from 'expo-router/html'; - -// This file is web-only and used to configure the root HTML for every -// web page during static rendering. -// The contents of this function only run in Node.js environments and -// do not have access to the DOM or browser APIs. -export default function Root({ children }: { children: React.ReactNode }) { - return ( - - - - - - - {/* - Disable body scrolling on web. This makes ScrollView components work closer to how they do on native. - However, body scrolling is often nice to have for mobile web. If you want to enable it, remove this line. - */} - - - {/* Using raw CSS styles as an escape-hatch to ensure the background color never flickers in dark-mode. */} -