-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
81 lines (74 loc) · 2.3 KB
/
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
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
import React, { useState } from 'react';
import { Provider as PaperProvider } from 'react-native-paper';
import { NavigationContainer } from '@react-navigation/native';
import { createStackNavigator } from '@react-navigation/stack';
import LoadingScreen from './components/LoadingScreen';
import Home from './screens/Home/Home.js';
import Note from './screens/Note';
import Players from './screens/Players';
import Chicken from './screens/Chicken';
import Results from './screens/Results';
import Context from './Context';
import AppLoading from 'expo-app-loading';
import {
useFonts,
Montserrat_800ExtraBold,
Montserrat_800ExtraBold_Italic,
Montserrat_700Bold,
Montserrat_700Bold_Italic,
Montserrat_600SemiBold,
Montserrat_600SemiBold_Italic,
Montserrat_900Black_Italic,
Montserrat_900Black,
} from '@expo-google-fonts/montserrat';
const Stack = createStackNavigator();
export default function App() {
const [progressDone, setProgressDone] = useState(true);
const [billValue, setBillValue] = useState(true);
const [allPlayerNames, setAllPlayerNames] = useState('');
const [riskyLevel, setriskyLevel] = useState('');
const [scoreResults, setScoreResults] = useState([]);
let [isFontsLoaded] = useFonts({
Montserrat_800ExtraBold,
Montserrat_800ExtraBold_Italic,
Montserrat_700Bold,
Montserrat_700Bold_Italic,
Montserrat_900Black_Italic,
Montserrat_900Black,
Montserrat_600SemiBold,
Montserrat_600SemiBold_Italic,
});
if (!isFontsLoaded) {
return <AppLoading />;
} else {
return (
<Context.Provider
value={{
progressDone,
setProgressDone,
billValue,
setBillValue,
allPlayerNames,
setAllPlayerNames,
riskyLevel,
setriskyLevel,
scoreResults,
setScoreResults,
}}
>
<PaperProvider>
<NavigationContainer>
<Stack.Navigator screenOptions={{ headerShown: false }}>
{progressDone && <Stack.Screen name='LoadingScreen' component={LoadingScreen} />}
<Stack.Screen name='Home' component={Home} />
<Stack.Screen name='Note' component={Note} />
<Stack.Screen name='Players' component={Players} />
<Stack.Screen name='Chicken' component={Chicken} />
<Stack.Screen name='Results' component={Results} />
</Stack.Navigator>
</NavigationContainer>
</PaperProvider>
</Context.Provider>
);
}
}