From 5b4ece16f09e8a60a3e399c00bb4cb35b64fa4d0 Mon Sep 17 00:00:00 2001 From: Arthi-chaud Date: Sat, 6 Aug 2022 10:37:22 +0200 Subject: [PATCH] Front: Router: Use basic constants to use either public or protected routes --- front/App.tsx | 33 +++++++++------------------------ 1 file changed, 9 insertions(+), 24 deletions(-) diff --git a/front/App.tsx b/front/App.tsx index 353a73a..f3c5996 100644 --- a/front/App.tsx +++ b/front/App.tsx @@ -1,33 +1,18 @@ -import { StatusBar } from 'expo-status-bar'; -import { Text, View, ColorValue } from 'react-native'; -import { Provider as PaperProvider, useTheme } from 'react-native-paper'; +import { NavigationContainer } from '@react-navigation/native'; +import { Provider as PaperProvider } from 'react-native-paper'; import Theme from './Theme'; +import { Stack, protectedRoutes, publicRoutes } from './Navigation'; -const ExampleBox = (props: { textColor: ColorValue, backgroundColor: ColorValue }) => ( - - Hello - -) - -export function AppContent() { - const { colors } = useTheme(); - return ( - - - - - - - - - - ); -} +const isAuthentified = true; export default function App() { return ( - + + + { isAuthentified ? protectedRoutes : publicRoutes } + + ); }