-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
91 lines (88 loc) · 2.88 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
82
83
84
85
86
87
88
89
90
91
import { StatusBar } from "expo-status-bar";
import { StyleSheet, SafeAreaView } from "react-native";
import { NavigationContainer } from "@react-navigation/native";
import { createNativeStackNavigator } from "@react-navigation/native-stack";
import { Provider } from "react-redux";
import { store } from "./src/app/store";
import IndexPage from "./src/pages/IndexPage";
import PokemonPage from "./src/pages/PokemonPage";
import SearchPage from "./src/pages/SearchPage";
import AboutPage from "./src/pages/AboutPage";
import AboutButton from "./src/components/AboutPage/AboutButton";
import { AppStyles } from "./src/config/Styles";
const Stack = createNativeStackNavigator();
export default function App() {
return (
<Provider store={store}>
<SafeAreaView style={styles.container}>
<NavigationContainer>
<Stack.Navigator initialRouteName="Home">
<Stack.Screen
name="Home"
component={IndexPage}
options={({ navigation }) => ({
title: "Pokedex",
headerStyle: {
backgroundColor: AppStyles.colors.headerColor,
},
headerTintColor: "#fff",
headerTitleStyle: {
fontWeight: "bold",
},
headerRight: () => <AboutButton navigation={navigation} />,
})}
/>
<Stack.Screen
name="PokemonPage"
component={PokemonPage}
options={{
title: "Pokemon details",
headerStyle: {
backgroundColor: AppStyles.colors.headerColor,
},
headerTintColor: "#fff",
headerTitleStyle: {
fontWeight: "bold",
},
}}
/>
<Stack.Screen
name="SearchPage"
component={SearchPage}
options={{
title: "Search Pokemon",
headerStyle: {
backgroundColor: AppStyles.colors.headerColor,
},
headerTintColor: "#fff",
headerTitleStyle: {
fontWeight: "bold",
},
}}
/>
<Stack.Screen
name="AboutPage"
component={AboutPage}
options={{
title: "About this app",
headerStyle: {
backgroundColor: AppStyles.colors.headerColor,
},
headerTintColor: "#fff",
headerTitleStyle: {
fontWeight: "bold",
},
}}
/>
</Stack.Navigator>
<StatusBar style="light" />
</NavigationContainer>
</SafeAreaView>
</Provider>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
},
});