-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathApp.js
67 lines (62 loc) · 1.59 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
import React from "react";
import { createStackNavigator } from "@react-navigation/stack";
import { NavigationContainer, DefaultTheme } from "@react-navigation/native";
import AppLoading from 'expo-app-loading';
import { StyleSheet, View, ActivityIndicator } from 'react-native';
import Home from "./screens/Home";
import Details from "./screens/Details";
import Profile from "./screens/Profile";
import {
useFonts,
Inter_900Black,
Inter_600SemiBold,
Inter_500Medium,
Inter_400Regular,
Inter_300Light,
} from '@expo-google-fonts/inter';
const Stack = createStackNavigator();
const theme = {
...DefaultTheme,
colors: {
...DefaultTheme.colors,
background: "transparent"
}
}
const App = () => {
const [fontsLoaded] = useFonts({
Inter_900Black,
Inter_600SemiBold,
Inter_500Medium,
Inter_400Regular,
Inter_300Light,
});
if (!fontsLoaded) {
return (
<View style={styles.container}>
<ActivityIndicator size="large" color="red" />
<AppLoading />
</View>
);
} else {
return (
<NavigationContainer theme={theme}>
<Stack.Navigator screenOptions={{ headerShown: false }} initialRouteName="Home">
<Stack.Screen name="Home" component={Home} />
<Stack.Screen name="Details" component={Details} />
<Stack.Screen name="Profile" component={Profile} />
</Stack.Navigator>
</NavigationContainer>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
},
main: {
justifyContent: 'center',
flex: 1,
}
});
export default App;