-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
120 lines (111 loc) · 2.85 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
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
109
110
111
112
113
114
115
116
117
118
119
120
import 'react-native-gesture-handler';
import React, { useEffect } from 'react';
import { NavigationContainer } from '@react-navigation/native';
import { createStackNavigator } from '@react-navigation/stack';
import { Text } from 'react-native';
import Match from './components/screens/Matching/Match';
import Top from './components/screens/Auth/Top';
import Load from './components/screens/Auth/Load';
import Signin from './components/screens/Auth/SignIn';
import Signup from './components/screens/Auth/Signup';
import { SafeAreaProvider } from 'react-native-safe-area-context';
import Chat from './components/screens/Chat';
import Start from './components/screens/Matching/Start';
import ChatIndex from './components/screens/ChatIndex';
import TestTorScreen from './components/screens/TestTorScreen';
import { APIHandler } from './util/api';
const theme = {
headerStyle: {
backgroundColor: '#4FCDF5',
},
headerTintColor: '#fff',
headerTitleStyle: {
fontWeight: 'bold',
},
};
const Stack = createStackNavigator();
const config = {
screens: {
Load: {
path: 'result',
parse: {
result: (data) => `?result=${data}`,
},
stringify: {
result: (data) => {
return data.replace(/^\?result=/, '');
},
},
},
},
};
const linking = {
prefixes: ['https://anomatch.com', 'anomatch://'],
config,
};
const App = () => {
// prefetch to establish TCP connection to API server
// useEffect(() => {
// new APIHandler('/').get().then(console.log);
// }, []);
return (
// <SafeAreaProvider>
<NavigationContainer linking={linking} fallback={<Text>Loading...</Text>}>
<Stack.Navigator>
<Stack.Screen
name="TOP"
component={Top}
options={{
headerShown: false
}}
/>
<Stack.Screen
name="Load"
component={Load}
options={{
headerShown: false
}}
/>
<Stack.Screen
name="Signup"
component={Signup}
options={theme}
/>
<Stack.Screen
name="Signin"
component={Signin}
options={theme}
/>
<Stack.Screen
name="Start"
component={Start}
options={theme}
/>
<Stack.Screen
name="Match"
component={Match}
options={theme}
/>
<Stack.Screen
name="Chat"
component={Chat}
options={theme}
/>
<Stack.Screen
name="ChatIndex"
component={ChatIndex}
options={theme}
/>
<Stack.Screen
name="TestTor"
component={TestTorScreen}
options={{
headerShown: false
}}
/>
</Stack.Navigator>
</NavigationContainer>
// </SafeAreaProvider>
);
};
export default App;