-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStackNavigator.js
More file actions
26 lines (24 loc) · 1.26 KB
/
Copy pathStackNavigator.js
File metadata and controls
26 lines (24 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import React from 'react'
import { createNativeStackNavigator } from '@react-navigation/native-stack';
import {LogIn,Register} from './auth';
import { Accueil,Profil,CreateAlerte,NotifPage,CreatePost } from './pages';
import { useSelector } from 'react-redux'
const StackNavigator = () => {
const Stack = createNativeStackNavigator();
const counter = useSelector(state=>state?.counter)
return (
<Stack.Navigator>
{counter.value===null ? (<>
<Stack.Screen name="LogIn" component={LogIn} options={{ headerShown:false }}/>
<Stack.Screen name="Register" component={Register} options={{ headerShown:false }}/>
</>):(<>
<Stack.Screen name="Accueil" component={Accueil} options={{ headerShown:false }}/>
<Stack.Screen name="Profil" component={Profil} options={{ headerShown:false }}/>
<Stack.Screen name="CreateAlerte" component={CreateAlerte} options={{ headerShown:false }}/>
<Stack.Screen name="NotifPage" component={NotifPage} options={{ headerShown:false }}/>
<Stack.Screen name="CreatePost" component={CreatePost} options={{ headerShown:false }}/>
</>)}
</Stack.Navigator>
)
}
export default StackNavigator