-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.tsx
36 lines (32 loc) · 1.09 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
import 'react-native-gesture-handler';
import { StatusBar } from 'expo-status-bar';
import * as ScreenOrientation from 'expo-screen-orientation';
import React from 'react';
import { SafeAreaProvider } from 'react-native-safe-area-context';
import * as Device from 'expo-device';
import Navigation from './navigation';
import { SessionProvider } from './util/session';
export default function App() {
React.useEffect(() => {
Device.getDeviceTypeAsync().then(type => {
/*According to Expo docs,
0 is unknown, 1 is phone, 2 is tablet, 3 is desktop, 4 is tv*/
if (type != 2) {
ScreenOrientation.lockAsync(ScreenOrientation.OrientationLock.PORTRAIT_UP);
}
}).catch(() => undefined);
// // debug axios
// axiosInstance.interceptors.request.use(request => {
// console.log(`Starting Request to ${request.url} with params`, request.params, ":", request);
// return request;
// });
}, []);
return (
<SafeAreaProvider>
<SessionProvider>
<Navigation />
<StatusBar />
</SessionProvider>
</SafeAreaProvider>
);
}