-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
66 lines (58 loc) · 2.02 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
import { StatusBar } from 'expo-status-bar';
import { Button, FlatList, Image, StyleSheet, Text, TouchableOpacity, View } from 'react-native';
import * as React from 'react';
import { NavigationContainer } from '@react-navigation/native';
import { createNativeStackNavigator } from '@react-navigation/native-stack';
import { Montserrat_500Medium, Montserrat_700Bold, useFonts } from '@expo-google-fonts/montserrat';
import { Rubik_300Light } from '@expo-google-fonts/rubik';
import { useEffect } from 'react';
import HomeScreen from './Screens/HomeScreen'
import AboutScreen from './Screens/AboutScreen'
import VolunteeringScreen from './Screens/VolunteeringScreen';
import AppointmentsScreen from './Screens/AppointmentsScreen';
import SnapInfoScreen from './Screens/SnapInfoScreen';
import RecipesScreen from './Screens/RecipesScreen';
import NewsScreen from './Screens/NewsScreen';
const Stack = createNativeStackNavigator();
function App() {
const [loaded, error] = useFonts({
Montserrat_500Medium,
Montserrat_700Bold,
Rubik_300Light,
});
if (!loaded && !error) {
return null;
}
if (error) {
return (
<View style={styles.errorContainer}>
<Text style={styles.errorText}>Error loading fonts</Text>
</View>
);
}
return (
<NavigationContainer>
<Stack.Navigator>
<Stack.Screen name="Home" component={HomeScreen}/>
<Stack.Screen name="About" component={AboutScreen}/>
<Stack.Screen name="Volunteering" component={VolunteeringScreen}/>
<Stack.Screen name="Appointments" component={AppointmentsScreen}/>
<Stack.Screen name="SnapInfo" component={SnapInfoScreen}/>
<Stack.Screen name="Recipes" component={RecipesScreen}/>
<Stack.Screen name="News" component={NewsScreen}/>
</Stack.Navigator>
</NavigationContainer>
);
}
const styles = StyleSheet.create({
errorContainer: {
flex: 1,
alignItems: 'center',
justifyContent: 'center',
},
errorText: {
fontSize: 18,
color: 'red',
},
});
export default App;