This repository has been archived by the owner on Jan 19, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathApp.tsx
108 lines (102 loc) · 4.06 KB
/
App.tsx
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
import React from 'react';
import { View } from "react-native";
import { NavigationContainer } from '@react-navigation/native';
import { createNativeStackNavigator } from '@react-navigation/native-stack';
import 'react-native-gesture-handler';
import { SafeAreaProvider } from 'react-native-safe-area-context';
import { Colors } from 'react-native/Libraries/NewAppScreen';
import { ApplicationProvider, IconRegistry } from '@ui-kitten/components';
import * as eva from "@eva-design/eva";
import { EvaIconsPack } from "@ui-kitten/eva-icons";
import SettingsView from './ui/settings/SettingsView';
import ProfileView from './ui/chat/ProfileView';
import StartView from './ui/start/StartView';
import { ChatViewWrapper } from './ui/chat/ChatView';
import ConversationsListView from './ui/conversationlist/ConversationsListView';
import NewConversationView from './ui/newconversation/NewConversation';
import PreStartView from './ui/prestart/PreStartView';
import LicensesView from './ui/licenses/LicensesView';
import NewContactView from './ui/newcontact/NewContactView';
import SelfProfileView from './ui/selfprofile/SelfProfileView';
import { Routes } from "./ui/constants";
const Stack = createNativeStackNavigator();
// TODO: Set statusbar color depending on the color scheme
// TODO: The self-profile is pretty janky. REWORK!
// TODO: Refactor ALL caches as they are not neccessary. WatermelonDB already does caching.
// TODO: Also use WatermelonDB's synchronization code for our messages
// => Have a background task running every n minutes if we have unsent messages and try to send them
// TODO: Use WatermelonDB relations instead of adding metadata ourself
const App = () => {
//const isDarkMode = useColorScheme() === "dark";
const isDarkMode = true;
return (
<View style={{ flex: 1, backgroundColor: Colors.darker }}>
<IconRegistry icons={EvaIconsPack} />
<SafeAreaProvider>
<ApplicationProvider {...eva} theme={eva.dark}>
<NavigationContainer>
<Stack.Navigator initialRouteName={Routes.PRESTART}>
<Stack.Screen
name={Routes.CONVERSATIONLIST}
options={{
headerShown: false
}}
component={ConversationsListView} />
<Stack.Screen
name={Routes.CONVERSATION}
options={{
headerShown: false
}}
component={ChatViewWrapper} />
<Stack.Screen
name={Routes.PROFILE}
options={({route}) => ({
headerShown: false
})}
component={ProfileView} />
<Stack.Screen
name={Routes.PRESTART}
options={{ headerShown: false }}
component={PreStartView} />
<Stack.Screen
name={Routes.START}
options={{ headerShown: false }}
component={StartView} />
<Stack.Screen
name={Routes.NEWCONVERSATION}
options={{
headerShown: false
}}
component={NewConversationView} />
<Stack.Screen
name={Routes.NEWCONTACT}
options={{
headerShown: false
}}
component={NewContactView} />
<Stack.Screen
name={Routes.SETTINGS}
options={{
headerShown: false
}}
component={SettingsView} />
<Stack.Screen
name={Routes.LICENSES}
options={{
headerShown: false
}}
component={LicensesView} />
<Stack.Screen
name={Routes.SELFPROFILE}
options={{
headerShown: false
}}
component={SelfProfileView} />
</Stack.Navigator>
</NavigationContainer>
</ApplicationProvider>
</SafeAreaProvider>
</View>
);
};
export default App;