-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.tsx
44 lines (42 loc) · 1.16 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
import { StyleSheet, Text, View, SafeAreaView } from "react-native";
import { NavigationContainer } from "@react-navigation/native";
import { useFonts } from "expo-font";
import { StackNavigator } from "./Components/TabsNavigator";
import LoadingSpinner from "./utilities/LoadingSpinner";
import i18n from "./Localization/Strings";
import { LanguageProvider } from "./Contexts/LanguageContext";
import { DisplayModeProvider } from "./Contexts/DisplayModeContext";
export default function App() {
const [loaded] = useFonts({
"Anton-Regular": require("./assets/fonts/Anton-Regular.ttf"),
});
i18n.loadResources();
if (!loaded) {
return (
<SafeAreaView style={styles.container}>
<View style={styles.loading}>
<LoadingSpinner />
</View>
</SafeAreaView>
);
}
return (
<DisplayModeProvider>
<LanguageProvider>
<NavigationContainer>
<StackNavigator />
</NavigationContainer>
</LanguageProvider>
</DisplayModeProvider>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
},
loading: {
flex: 1,
alignItems: "center",
justifyContent: "center",
},
});