Advertisement
Guest User

Untitled

a guest
Feb 21st, 2020
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import Icon from 'react-native-ionicons';
  2. import React from 'react';
  3. import {createAppContainer} from 'react-navigation';
  4. import {createDrawerNavigator} from 'react-navigation-drawer';
  5.  
  6. import CustomDrawerNavigator from './components/CustomDrawerNavigator';
  7. import StartView from './components/StartView';
  8. import {createStackNavigator} from 'react-navigation-stack';
  9. import CameraComponent from './components/AddRequest/CameraComponent';
  10. import SelectAnimal from './components/AddRequest/SelectAnimal';
  11. import DataInfo from './components/AddRequest/DataInfo';
  12. import LocationInfo from './components/AddRequest/LocationInfo';
  13. import SummaryComponent from './components/AddRequest/SummaryComponent';
  14. import Profile from './components/Profile/Profile';
  15. import EditProfile from './components/Profile/EditProfile';
  16. import SelectLogin from './components/Profile/SelectLogin';
  17. import RegularLogin from './components/Profile/RegularLogin';
  18. import UniqueCodeLogin from './components/Profile/UniqueCodeLogin';
  19. import LostPosts from './components/Posts/LostPosts';
  20. import FindPosts from './components/Posts/FindPosts';
  21. import AddComment from './components/Posts/AddComment';
  22. import {withNavigationFocus} from 'react-navigation';
  23. const FindPostsFocus = withNavigationFocus(FindPosts);
  24. const LostPostsFocus = withNavigationFocus(LostPosts);
  25. const MainNavigator = createDrawerNavigator(
  26.   {
  27.     Home: {
  28.       navigationOptions: {
  29.         drawerIcon: ({tintColor}) => (
  30.           <Icon name="md-home" style={{color: tintColor}} />
  31.         ),
  32.         drawerLabel: 'Strona główna',
  33.       },
  34.       screen: StartView,
  35.     },
  36.  
  37.     Profile: {
  38.       navigationOptions: {
  39.         drawerIcon: ({tintColor}) => (
  40.           <Icon name="md-person" style={{color: tintColor}} />
  41.         ),
  42.         drawerLabel: 'Mój profil',
  43.       },
  44.       screen: Profile,
  45.       initialRouteName: Profile,
  46.     },
  47.     Settings2: {
  48.       navigationOptions: {
  49.         drawerIcon: ({tintColor}) => (
  50.           <Icon name="md-alert" style={{color: tintColor}} />
  51.         ),
  52.         drawerLabel: 'Zauważone zwierzęta',
  53.       },
  54.       screen: FindPostsFocus,
  55.     },
  56.     Settings3: {
  57.       navigationOptions: {
  58.         drawerIcon: ({tintColor}) => (
  59.           <Icon name="md-help" style={{color: tintColor}} />
  60.         ),
  61.         drawerLabel: 'Zgubione zwierzęta',
  62.       },
  63.       screen: LostPostsFocus,
  64.     },
  65.     SelectLogin: {
  66.       navigationOptions: {
  67.         drawerIcon: ({tintColor}) => (
  68.           <Icon name="md-log-in" style={{color: tintColor}} />
  69.         ),
  70.         drawerLabel: 'Zaloguj się',
  71.       },
  72.       screen: SelectLogin,
  73.     },
  74.     /*
  75.     About: {
  76.       navigationOptions: {
  77.         drawerIcon: ({tintColor}) => (
  78.           <Ionicons name="ios-person" style={{color: tintColor}} />
  79.         ),
  80.         drawerLabel: 'About',
  81.       },
  82.       screen: About,
  83.     },
  84.     */
  85.   },
  86.   {
  87.     contentComponent: CustomDrawerNavigator,
  88.   },
  89. );
  90. export const AppStack = createStackNavigator(
  91.   {
  92.     MainNavigator: {
  93.       screen: MainNavigator,
  94.       navigationOptions: {
  95.         header: null,
  96.         gesturesEnabled: false,
  97.       },
  98.     },
  99.  
  100.     Camera: {
  101.       screen: CameraComponent,
  102.       navigationOptions: {
  103.         header: null,
  104.         gesturesEnabled: false,
  105.       },
  106.     },
  107.     StartView: {
  108.       screen: StartView,
  109.       navigationOptions: {
  110.         header: null,
  111.         gesturesEnabled: false,
  112.       },
  113.     },
  114.     SelectAnimal: {
  115.       screen: SelectAnimal,
  116.       navigationOptions: {
  117.         header: null,
  118.         gesturesEnabled: false,
  119.       },
  120.     },
  121.     DataInfo: {
  122.       screen: DataInfo,
  123.       navigationOptions: {
  124.         header: null,
  125.         gesturesEnabled: false,
  126.       },
  127.     },
  128.     LocationInfo: {
  129.       screen: LocationInfo,
  130.       navigationOptions: {
  131.         header: null,
  132.         gesturesEnabled: false,
  133.       },
  134.     },
  135.     SummaryComponent: {
  136.       screen: SummaryComponent,
  137.       navigationOptions: {
  138.         header: null,
  139.         gesturesEnabled: false,
  140.       },
  141.     },
  142.     EditProfile: {
  143.       screen: EditProfile,
  144.       navigationOptions: {
  145.         header: null,
  146.         gesturesEnabled: false,
  147.       },
  148.     },
  149.     RegularLogin: {
  150.       screen: RegularLogin,
  151.       navigationOptions: {
  152.         header: null,
  153.         gesturesEnabled: false,
  154.       },
  155.     },
  156.     UniqueCodeLogin: {
  157.       screen: UniqueCodeLogin,
  158.       navigationOptions: {
  159.         header: null,
  160.         gesturesEnabled: false,
  161.       },
  162.     },
  163.     AddComment: {
  164.       screen: AddComment,
  165.       navigationOptions: {
  166.         header: null,
  167.         gesturesEnabled: false,
  168.       },
  169.     },
  170.   },
  171.   {headerMode: 'none'},
  172. );
  173. /*
  174. export const OtherNavigator = createStackNavigator(
  175.   {
  176.     MainNavigator: {
  177.       screen: MainNavigator,
  178.       navigationOptions: {
  179.         header: null,
  180.         gesturesEnabled: false,
  181.       },
  182.     },
  183.   },
  184.  
  185.   {
  186.     Camera: {
  187.       screen: Camera,
  188.       initialRouteName:'Camera',
  189.       navigationOptions: {
  190.         header: null,
  191.       },
  192.     },
  193.   },
  194.   {headerMode: 'none'},
  195. );
  196. */
  197. /*
  198. const OtherNavigator = createStackNavigator(
  199.   {
  200.     MainNavigator: {
  201.       screen: MainNavigator,
  202.     },
  203.   },
  204.   {
  205.     Camera: {
  206.       screen: Camera,
  207.       navigationOptions: {
  208.         header: null,
  209.         gesturesEnabled: false,
  210.         headerMode: 'none',
  211.       },
  212.     },
  213.   },
  214.   {headerMode: 'none'},
  215. );
  216. */
  217. const MainApp = createAppContainer(AppStack);
  218. export default MainApp;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement