-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathApp.js
64 lines (57 loc) · 2.03 KB
/
App.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
// import { StatusBar } from "expo-status-bar";
import "./ignoreWarnings";
import React from "react";
import { StyleSheet, Text, View } from "react-native";
import { NavigationContainer } from "@react-navigation/native";
import { createNativeStackNavigator } from "@react-navigation/native-stack";
import Login from "./src/page/login";
import Signup from "./src/page/signup";
import Home from "./src/page/home";
import Chatscreen from "./src/page/chatscreen";
import Room from "./src/page/room";
import Settings from "./src/page/settings";
import Eventscreen from "./src/page/event";
import Channelscreen from "./src/page/channelList";
import { StreamChat } from "stream-chat";
import { ChannelList, Chat, OverlayProvider } from "stream-chat-expo";
import { useChatClient } from "./useChatClient";
import { chatApiKey } from "./chatConfig";
import Test from "./src/page/test";
import GameRoom from "./src/page/gameRoom";
const chatClient = StreamChat.getInstance(chatApiKey);
export const AppContext = React.createContext();
const Stack = createNativeStackNavigator();
export default function App() {
// const { clientIsReady } = useChatClient();
// if (!clientIsReady) {
// return <Text>Loading chat ...</Text>;
// }
console.log("app restarted");
return (
<NavigationContainer>
<OverlayProvider>
<Chat client={chatClient}>
<AppContext.Provider value={"hello"}>
<Stack.Navigator>
<Stack.Screen
name='Login'
component={Login}
options={{ headerTitle: "", headerTransparent: true }}
/>
<Stack.Screen
name='Signup'
component={Signup}
options={{ headerTransparent: true }}
/>
<Stack.Screen
options={{ headerShown: false }}
name='Home'
component={Home}
/>
</Stack.Navigator>
</AppContext.Provider>
</Chat>
</OverlayProvider>
</NavigationContainer>
);
}