-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
74 lines (71 loc) · 2.29 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
65
66
67
68
69
70
71
72
73
74
import * as React from "react";
import { useColorScheme, Image, TouchableOpacity } from "react-native";
import {
NavigationContainer,
DefaultTheme,
DarkTheme,
} from "@react-navigation/native";
import { createNativeStackNavigator } from "@react-navigation/native-stack";
import HomeView from "./src/modules/Home/HomeView";
import LoginView from "./src/modules/Login/LoginView";
import NewChatView from "./src/modules/NewChat/NewChatView";
import { initializeApp } from "firebase/app";
import ChatView from "./src/modules/Chat/ChatView";
import ProfileView from "./src/modules/Profile/ProfileView";
import configureStore from "./src/store";
import { Provider } from "react-redux";
const Stack = createNativeStackNavigator();
const store = configureStore();
function App() {
const scheme = useColorScheme();
return (
<Provider store={store}>
<NavigationContainer theme={scheme === "dark" ? DarkTheme : DefaultTheme}>
<Stack.Navigator initialRouteName="Home">
<Stack.Screen
name="Home"
component={HomeView}
options={({ navigation }) => ({
title: "Tasky",
headerRight: () => (
<TouchableOpacity
onPress={() => {
navigation.navigate("Profile");
}}
>
<Image
source={{
uri: "https://reactjs.org/logo-og.png",
}}
style={{ width: 32, height: 32, borderRadius: 32 / 2 }}
/>
</TouchableOpacity>
),
})}
/>
<Stack.Screen
name="Login"
component={LoginView}
options={{ headerShown: false }}
/>
<Stack.Screen
name="Profile"
component={ProfileView}
options={{ headerShown: true }}
/>
<Stack.Screen
name="Chat"
component={ChatView}
options={{ headerShown: false }}
/>
<Stack.Screen
name="NewChat"
component={NewChatView}
options={{ headerShown: true, title: "Select User" }}
/>
</Stack.Navigator>
</NavigationContainer>
</Provider>
);
}
export default App;