-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
33 lines (30 loc) · 871 Bytes
/
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
import { NavigationContainer } from '@react-navigation/native';
import AuthNavigation from './src/navigation/AuthNavigation';
import MainNavigation from './src/navigation/MainNavigation';
import { AuthProvider, useAuth } from './src/context/AuthContext';
import { LocationProvider } from './src/context/useLocationContext';
import { StatusBar } from 'react-native';
const AppContent = () => {
const { isAuthenticated } = useAuth();
return (
<NavigationContainer>
{
isAuthenticated ?
<>
<LocationProvider>
<MainNavigation />
</LocationProvider>
</>
: <AuthNavigation />
}
</NavigationContainer>
);
};
export default function App() {
return (
<AuthProvider>
<StatusBar backgroundColor="#000" barStyle="dark-content"/>
<AppContent />
</AuthProvider>
);
}