-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.tsx
81 lines (75 loc) · 2.39 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
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 { ApolloClient, ApolloProvider, InMemoryCache } from "@apollo/client";
import { NavigationContainer } from "@react-navigation/native";
import { createNativeStackNavigator } from "@react-navigation/native-stack";
import * as React from "react";
import { QueryClient, QueryClientProvider } from "react-query";
import HomeScreen from "./src/screens/Home";
import LogisticHome from "./src/screens/logistics/LogisticHome";
import MovieDetail from "./src/screens/movies/MovieDetail";
import MovieHome from "./src/screens/movies/MovieHome";
import PokemonDetail from "./src/screens/pokemons/PokemonDetail";
import PokemonHome from "./src/screens/pokemons/PokemonHome";
const Stack = createNativeStackNavigator();
const apolloClient = new ApolloClient({
uri: "https://graphql-pokeapi.graphcdn.app/",
cache: new InMemoryCache(),
});
const queryClient = new QueryClient({
defaultOptions: {
mutations: {},
queries: {
refetchOnMount: false,
refetchOnReconnect: false,
refetchOnWindowFocus: false,
},
},
});
const App = () => {
return (
<ApolloProvider client={apolloClient}>
<QueryClientProvider client={queryClient}>
<NavigationContainer>
<Stack.Navigator initialRouteName="Home">
<Stack.Screen name="Home" component={HomeScreen} />
<Stack.Screen
name="LogisticHome"
component={LogisticHome}
options={{
headerTitle: "Logistics",
}}
/>
<Stack.Screen
name="MovieHome"
component={MovieHome}
options={{
headerTitle: "Movies",
}}
/>
<Stack.Screen
name="MovieDetail"
component={MovieDetail}
options={{
headerTitle: "Movie's Detail",
}}
/>
<Stack.Screen
name="PokemonHome"
component={PokemonHome}
options={{
headerTitle: "Pokemons",
}}
/>
<Stack.Screen
name="PokemonDetail"
component={PokemonDetail}
options={{
headerTitle: "Pokemon's Detail",
}}
/>
</Stack.Navigator>
</NavigationContainer>
</QueryClientProvider>
</ApolloProvider>
);
};
export default App;