-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
62 lines (52 loc) · 1.58 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
import 'react-native-gesture-handler';
import React from 'react';
import AsyncStorage from '@react-native-async-storage/async-storage';
import Parse from 'parse/react-native';
import { NavigationContainer } from '@react-navigation/native';
import { createStackNavigator } from '@react-navigation/stack';
import WrapperPage from './src/components/WrapperPage';
import { UserRegistration } from './src/pages/UserRegistration';
import { UserLogIn } from './src/pages/UserLogIn';
import { UserLogOut } from './src/pages/UserLogOut';
import { Chat } from './src/pages/Chat';
import { APP_ID, JAVASCRIPT_KEY } from '@env';
Parse.setAsyncStorage(AsyncStorage);
const PARSE_APPLICATION_ID = APP_ID;
const PARSE_HOST_URL = 'https://parseapi.back4app.com/';
const PARSE_JAVASCRIPT_ID = JAVASCRIPT_KEY;
Parse.initialize(PARSE_APPLICATION_ID, PARSE_JAVASCRIPT_ID);
Parse.serverURL = PARSE_HOST_URL;
function UserRegistrationScreen() {
return (
<WrapperPage>
<UserRegistration />
</WrapperPage>
);
}
function UserLogInScreen() {
return (
<WrapperPage>
<UserLogIn />
</WrapperPage>
);
}
function ChatScreen() {
return (
<WrapperPage>
<Chat />
</WrapperPage>
);
}
const Stack = createStackNavigator();
const App = () => {
return (
<NavigationContainer>
<Stack.Navigator>
<Stack.Screen name='Login' component={UserLogInScreen} />
<Stack.Screen name='Chat' component={ChatScreen} />
<Stack.Screen name='Sign Up' component={UserRegistrationScreen} />
</Stack.Navigator>
</NavigationContainer>
);
};
export default App;