Application Android et IOS pour l'amicale des élèves
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

MainTabNavigator.js 1.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. import React from 'react';
  2. import {Platform} from 'react-native';
  3. import {createStackNavigator} from 'react-navigation';
  4. import {createMaterialBottomTabNavigator} from "react-navigation-material-bottom-tabs";
  5. import TabBarIcon from '../components/TabBarIcon';
  6. import HomeScreen from '../screens/HomeScreen';
  7. import PlanningScreen from '../screens/PlanningScreen';
  8. const HomeStack = createStackNavigator({
  9. Home: HomeScreen,
  10. });
  11. HomeStack.navigationOptions = {
  12. tabBarLabel: 'Home',
  13. tabBarIcon: ({focused}) => (
  14. <TabBarIcon
  15. focused={focused}
  16. name={
  17. Platform.OS === 'ios'
  18. ? 'ios-home'
  19. : 'md-home'
  20. }
  21. />
  22. ),
  23. };
  24. const ProfileStack = createStackNavigator({
  25. Profile: PlanningScreen,
  26. });
  27. ProfileStack.navigationOptions = {
  28. tabBarLabel: 'Profile',
  29. tabBarIcon: ({focused}) => (
  30. <TabBarIcon
  31. focused={focused}
  32. name={
  33. Platform.OS === 'ios'
  34. ? 'ios-people'
  35. : 'md-people'
  36. }
  37. />
  38. ),
  39. };
  40. export default createMaterialBottomTabNavigator(
  41. {
  42. Home: HomeStack,
  43. Profile: ProfileStack
  44. }, {
  45. initialRouteName: 'Home',
  46. shifting: true,
  47. activeColor: Colors.tabIconSelected,
  48. inactiveColor: Colors.tabIconDefault,
  49. barStyle: {backgroundColor: Colors.mainColor},
  50. }
  51. );