-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.tsx
42 lines (39 loc) · 1.32 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
import { NavigationContainer, RouteProp } from '@react-navigation/native'
import { createNativeStackNavigator } from '@react-navigation/native-stack'
import { Screens } from './src/navigation/screenNames'
import Detail from './src/screens/Detail/Detail'
import Home from './src/screens/Home/Home'
import { IPokemon } from './src/interfaces/pokemon.interfaces'
import Pokedex from './src/screens/Pokedex/Pokedex'
import AppProvider from './src/context/provider'
export type RootStackParamList = {
[Screens.HOME]: undefined
[Screens.DETAIL]: { pokemon: IPokemon }
[Screens.POKEDEX]?: { pokemon: IPokemon }
}
export default function App() {
const Stack = createNativeStackNavigator()
return (
<AppProvider>
<NavigationContainer>
<Stack.Navigator initialRouteName={Screens.HOME}>
<Stack.Screen
name={Screens.HOME}
options={{ headerShown: false }}
component={Home}
/>
<Stack.Screen
name={Screens.DETAIL}
options={{ headerShown: false, presentation: 'modal' }}
component={Detail}
/>
<Stack.Screen
name={Screens.POKEDEX}
options={{ headerShown: false }}
component={Pokedex}
/>
</Stack.Navigator>
</NavigationContainer>
</AppProvider>
)
}