Advertisement
Guest User

Untitled

a guest
Sep 15th, 2019
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.86 KB | None | 0 0
  1. import React from "react";
  2. import { View } from "react-native";
  3. import { createStackNavigator} from 'react-navigation';
  4. import { createMaterialBottomTabNavigator } from 'react-navigation-material-bottom-tabs';
  5. import Icon from 'react-native-vector-icons/Ionicons';
  6.  
  7. /////////SCREENS//////////
  8. import HomeScreen from "../screens/HomeScreen";
  9. import MatchesScreen from "../screens/MatchesScreen";
  10. import MessagesScreen from "../screens/MessagesScreen";
  11. import ProfileScreen from "../screens/ProfileScreen";
  12. /////////////////////////
  13.  
  14. const HomeStack = createStackNavigator({
  15. //Burası homescreen'i açar ama diyelimki senin detailscreen diye bir sayfaya geçiş yapman lazım. Ozaman
  16. //alta onu da eklemen lazım. Şu şekilde;
  17. HomeScreen
  18. DetailScreen // bunun gibi
  19. OtherDetail // Bitane daha
  20.  
  21. // birbirne bağlı olmayan screenler üzerinde hareket etmek için this.props.navigation.navigate('Detail') yerine
  22. // this.props.navigation.push('Detail') kullanırsan atlatabilirsin.
  23. },{
  24. navigationOptions:{
  25. tabBarLabel:'Keşfet',
  26. tabBarIcon: ({ tintColor }) => (
  27. <View>
  28. <Icon style={[{color: tintColor}]} size={25} name={'ios-search'}/>
  29. </View>),
  30. activeColor: '#fbf8fd',
  31. inactiveColor: '#bfa1f6',
  32. barStyle: { backgroundColor: '#6d6ff4' },
  33. }
  34. });
  35.  
  36.  
  37. const MatchesStack = createStackNavigator({
  38. MatchesScreen
  39. },{
  40. navigationOptions:{
  41. tabBarLabel:'Eşleşmeler',
  42. tabBarIcon: ({ tintColor }) => (
  43. <View>
  44. <Icon style={[{color: tintColor}]} size={25} name={'ios-heart-half'}/>
  45. </View>),
  46. activeColor: '#fcfefc',
  47. inactiveColor: '#ebaabd',
  48. barStyle: { backgroundColor: '#d13f60' },
  49. }
  50. });
  51.  
  52.  
  53. const MessagesStack = createStackNavigator({
  54. MessagesScreen
  55. },{
  56. navigationOptions:{
  57. header: null,
  58. tabBarLabel:'Mesajlar',
  59. tabBarIcon: ({ tintColor }) => (
  60. <View>
  61. <Icon style={[{color: tintColor}]} size={25} name={'ios-chatboxes'}/>
  62. </View>),
  63. activeColor: '#fbfefd',
  64. inactiveColor: '#a3c1fa',
  65. barStyle: { backgroundColor: '#296ff8' },
  66. }
  67. });
  68.  
  69.  
  70. const ProfileStack = createStackNavigator({
  71. ProfileScreen
  72. },{
  73. navigationOptions:{
  74. tabBarLabel:'Mesajlar',
  75. tabBarIcon: ({ tintColor }) => (
  76. <View>
  77. <Icon style={[{color: tintColor}]} size={25} name={'ios-person'}/>
  78. </View>),
  79. activeColor: '#fdfffd',
  80. inactiveColor: '#93c4c3',
  81. barStyle: { backgroundColor: '#1f6d6a' },
  82. }
  83. });
  84.  
  85. //Burda da export ederken MainTabNavigation diye const ediyorum bu sayede AppNavigation içinde import edebilirsin.
  86. export const MainTabNavigator = createMaterialBottomTabNavigator({
  87. HomeStack,
  88. MatchesStack,
  89. MessagesStack,
  90. ProfileStack
  91. },{
  92. initialRouteName:'HomeStack'
  93. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement