-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.tsx
46 lines (39 loc) · 1.1 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
import "react-native-gesture-handler";
import { StatusBar } from "expo-status-bar";
import React from "react";
import { SafeAreaProvider } from "react-native-safe-area-context";
import useCachedResources from "./src/hooks/useCachedResources";
import Navigation from "./src/navigation";
import Auth from "./src/screens/Auth/Auth";
import { observer } from "mobx-react";
import store, { loadSavedStore } from "./src/system/Store";
import { RootSiblingParent } from "react-native-root-siblings";
function App() {
React.useEffect(() => {
onLoad();
}, []);
const isLoadingComplete = useCachedResources();
const colorScheme = store.theme;
async function onLoad() {
await loadSavedStore();
}
if (!isLoadingComplete) {
return null;
} else {
return (
<RootSiblingParent>
<SafeAreaProvider>
{!store.token ? (
<Auth />
) : (
<>
<Navigation colorScheme={colorScheme} />
<StatusBar />
</>
)}
</SafeAreaProvider>
</RootSiblingParent>
);
}
}
export default observer(App);