Advertisement
Guest User

Untitled

a guest
Oct 14th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. import {
  2. BottomRoutes,
  3. NavigationDefinitionMap,
  4. TNavigatorOptions
  5. } from '../../lib/navigation'
  6. import {
  7. createBottomTabNavigator
  8. } from 'react-navigation-tabs'
  9. import RequestListScreen, {
  10. requestListNavigatorOptions
  11. } from '@screens/service-request/RequestListScreen'
  12. import ProfileViewScreen, {
  13. profileViewScreenNavigationOptions
  14. } from '@screens/profile/ProfileViewScreen'
  15. import { createStackNavigator } from 'react-navigation-stack'
  16. import BottomTabBar from '@navigation/navigators/BottomTabBar'
  17.  
  18. type BottomNavigationParams =
  19. Parameters<typeof createBottomTabNavigator>
  20.  
  21. const bottomRouteMaps: NavigationDefinitionMap<
  22. BottomRoutes,
  23. BottomNavigationParams[0][string]
  24. > = {
  25. RequestList: {
  26. screen: createStackNavigator({
  27. Request: {
  28. screen: RequestListScreen,
  29. navigationOptions: requestListNavigatorOptions
  30. }
  31. })
  32. },
  33. ProfileView: {
  34. screen: createStackNavigator({
  35. Profile: {
  36. screen: ProfileViewScreen,
  37. navigationOptions: profileViewScreenNavigationOptions
  38. }
  39. })
  40. }
  41. }
  42.  
  43. const configs: TNavigatorOptions<
  44. BottomRoutes,
  45. BottomNavigationParams[1]
  46. > = {
  47. initialRouteName: 'RequestList',
  48. tabBarComponent: BottomTabBar
  49. }
  50.  
  51. export default createBottomTabNavigator(
  52. bottomRouteMaps,
  53. configs
  54. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement