-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNavigator.js
44 lines (40 loc) · 1.37 KB
/
Navigator.js
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import { View, Text } from "react-native";
import React, { useEffect } from "react";
import useAuth from "./Context/useAuth";
import { createNativeStackNavigator } from "@react-navigation/native-stack";
import { Auth, Home, Chat } from "./screens";
import AccountModal from "./screens/AccountModal";
import Match from "./screens/Match";
import ChatUser from "./screens/ChatScreen";
const Stack = createNativeStackNavigator();
export default function Navigator() {
const { user } = useAuth();
// console.log(user);
return (
<Stack.Navigator
screenOptions={{
header: () => null,
}}
>
{!user ? (
<Stack.Screen name="Auth" component={Auth} />
) : (
<>
<Stack.Group>
<Stack.Screen name="Home" component={Home} />
<Stack.Screen name="Chat" component={Chat} />
<Stack.Screen name="ChatScreen" component={ChatUser} />
</Stack.Group>
<Stack.Group screenOptions={{presentation:'modal',animation:'slide_from_bottom'}} >
<Stack.Screen name = 'AccountModal'
component={AccountModal}/>
</Stack.Group>
<Stack.Group screenOptions={{presentation:'transparentModal',animation:'slide_from_right'}} >
<Stack.Screen name = 'Match'
component={Match}/>
</Stack.Group>
</>
)}
</Stack.Navigator>
);
}