Guest User

Untitled

a guest
Jan 17th, 2018
287
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.26 KB | None | 0 0
  1. const HomeTabNavigation = TabNavigator(
  2. {
  3. Profile: { screen: Profile },
  4. PhotoCard: { screen: PhotoCard },
  5. Chat: { screen: Chat }
  6. },
  7. {
  8. tabBarPosition: "top",
  9. initialRouteName: "PhotoCard",
  10. swipeEnabled: false,
  11. lazyLoad: false,
  12. animationEnabled: true,
  13. tabBarComponent: props => {
  14. return (
  15. <Header>
  16. <FooterTab>
  17. <Button
  18. onPress={() => {
  19. if (props.navigation.state.index !== 0) {
  20. props.navigation.navigate("Profile");
  21. this.props.setCurrentDisplayingScreen("Profile");
  22. }
  23. }}
  24. >
  25. <Icon
  26. name="md-person"
  27. size={20}
  28. style={
  29. props.navigation.state.index === 0
  30. ? styles.activeIcon
  31. : styles.inActiveIcon
  32. }
  33. />
  34. </Button>
  35.  
  36. <Button
  37. onPress={() => {
  38. if (props.navigation.state.index !== 1) {
  39. props.navigation.navigate("PhotoCard");
  40. this.props.setCurrentDisplayingScreen("PhotoCard");
  41. }
  42. }}
  43. >
  44. <Thumbnail
  45. small
  46. source={
  47. props.navigation.state.index === 1
  48. ? require("../../../assets/images/logo.png")
  49. : require("../../../assets/images/logo1.png")
  50. }
  51. />
  52. </Button>
  53.  
  54. <Button
  55. onPress={() => {
  56. if (props.navigation.state.index !== 2) {
  57. props.navigation.navigate("Chat");
  58. this.props.setCurrentDisplayingScreen("Chat");
  59. }
  60. }}
  61. >
  62. <Icon
  63. name="md-chatboxes"
  64. style={
  65. props.navigation.state.index === 2
  66. ? styles.activeIcon
  67. : styles.inActiveIcon
  68. }
  69. />
  70. <BadgeTabIcon />
  71. </Button>
  72. </FooterTab>
  73. </Header>
  74. );
  75. }
  76. }
  77. );
  78.  
  79. // Connect redux to call actions and receive new states
  80. export default connect(null, actions)(HomeTabNavigation);
Add Comment
Please, Sign In to add comment