-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.tsx
55 lines (50 loc) · 1.78 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
import {createNativeStackNavigator} from '@react-navigation/native-stack';
import React from 'react';
import UserScreen from './src/presentation/pages/UserScreen';
import {
DefaultTheme,
NavigationContainer,
RouteProp,
} from '@react-navigation/native';
import UserDetailScreen from './src/presentation/pages/UserDetailScreen';
import CharacterScreen from './src/presentation/pages/CharacterScreen';
import {QueryClient, QueryClientProvider} from 'react-query';
import PokemonScreen from './src/presentation/pages/PokemonScreen';
import {StatusBar} from 'react-native';
import {UserDetailParams} from './src/presentation/types/NavigationType';
const queryClient = new QueryClient();
const theme = Object.freeze({
...DefaultTheme,
colors: {
...DefaultTheme.colors,
background: '#fff',
},
});
export type AppStackParams = {
Pokemon: undefined;
Characters: undefined;
User: undefined;
UserDetail: UserDetailParams;
};
export type RootRouteProps<RouteName extends keyof AppStackParams> = RouteProp<
AppStackParams,
RouteName
>;
const Stack = createNativeStackNavigator<AppStackParams>();
export default function MyStack() {
return (
<QueryClientProvider client={queryClient}>
<StatusBar backgroundColor={'#fff'} barStyle={'dark-content'} />
<NavigationContainer theme={theme}>
<Stack.Navigator
initialRouteName="Pokemon"
screenOptions={{headerTitleStyle: {color: 'black'}}}>
<Stack.Screen name="Pokemon" component={PokemonScreen} />
<Stack.Screen name="Characters" component={CharacterScreen} />
<Stack.Screen name="User" component={UserScreen} />
<Stack.Screen name="UserDetail" component={UserDetailScreen} />
</Stack.Navigator>
</NavigationContainer>
</QueryClientProvider>
);
}