-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathApp.tsx
87 lines (82 loc) · 2.74 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
import React, {useState, useEffect, useContext} from 'react';
import {createDrawerNavigator} from '@react-navigation/drawer';
import firebase from 'firebase';
import {
requestInterceptor,
responseInterceptor,
} from './src/services/HttpInterceptor';
import {StatusBar, StyleSheet, View} from 'react-native';
import Home from './src/pages/Home/Home';
import AstroProfile from './src/pages/AstroProfile/AstroProfile';
import {NavigationContainer} from '@react-navigation/native';
import ScreenNavigation from './src/navigation/ScreenNavigation';
import {SafeAreaProvider, SafeAreaView} from 'react-native-safe-area-context';
import SignUp from './src/pages/Authentication/SignUp';
import {LoadingDialog} from './src/components/Molecules/LoadingDialog/LoadingDialog';
import {LoadingProvider} from './src/shared/LoadingProvider';
import {LoadingContext} from './src/shared/LoadingProvider';
import {AuthProvider} from './src/shared/AuthProvider';
import Chat from './src/pages/Chat/Chat';
import ChatList from './src/pages/Chat/ChatList';
import {
socket,
SocketContext,
SocketProvider,
} from './src/shared/SocketProvider';
import {IMessage} from 'react-native-gifted-chat';
import {MessageProvider} from './src/shared/MessageProvider';
import {VideoCallProvider} from './src/shared/VideoCallProvider';
import SplashScreen from 'react-native-splash-screen';
const Drawer = createDrawerNavigator();
export default function App() {
useEffect(() => {
SplashScreen.hide();
}, []);
const [viewedOnboarding, setViewedOnboarding] = useState(false);
const [loading, setLoading] = useState(false);
const checkOnBoarding = async () => {
try {
// const value = await AsyncStorage.getItem('@viewedOnboarding');
console.log('already onboarded');
// if (!value) {
// setViewedOnboarding(false);
// //change here
// }
} catch (err) {
console.error(err);
} finally {
setLoading(false);
}
};
useEffect(() => {
checkOnBoarding();
}, []);
const onPressLearnMore = () => {};
return (
<SafeAreaProvider>
<SocketProvider>
<MessageProvider>
<VideoCallProvider>
<LoadingProvider>
<AuthProvider>
<StatusBar hidden={false} animated />
<NavigationContainer>
<ScreenNavigation viewedOnboarding={viewedOnboarding} />
<LoadingDialog />
</NavigationContainer>
</AuthProvider>
</LoadingProvider>
</VideoCallProvider>
</MessageProvider>
</SocketProvider>
{/* <SignUp></SignUp> */}
</SafeAreaProvider>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
alignItems: 'center',
justifyContent: 'center',
},
});