Advertisement
Guest User

Untitled

a guest
Nov 17th, 2019
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.00 KB | None | 0 0
  1. "use strict";
  2. import TabBarComponent from "./TabBarComponent";
  3. import _ from 'lodash';
  4. const colorBackgroundTab = "#ffffff";
  5. const activeBackgroundColor = "#ffffff";
  6. export const colorActive = "#c21823";
  7. export const colorActiveTab1 = "rgb(27, 42, 56)";
  8. const colorInActive = "#9b9b9b";
  9. const colorLine = "#a8a8a8a9";
  10.  
  11. global.currentTab = _.isNil(global.currentTab) ? "Tab1" : global.currentTab;
  12. const TabNavigatorConfig = {
  13. tabBarComponent: TabBarComponent,
  14. initialRouteName: global.currentTab,
  15. tabBarPosition: "bottom", // or top,
  16. swipeEnabled: false, //whether to allow swiping between tabs
  17. animationEnabled: false, //whether to animate when changing tabs
  18. lazyLoad: false,
  19. tabBarOptions: {
  20. allowFontScaling: false,
  21. showLabel: true,
  22. upperCaseLabel: false,
  23. scrollEnabled: false,
  24. activeTintColor: colorActive,
  25. inactiveTintColor: colorInActive,
  26. inactiveBackgroundColor: colorBackgroundTab, //only for ios
  27. activeBackgroundColor: activeBackgroundColor, // only for ios,
  28. showIcon: true,
  29. style: {
  30. margin: 0,
  31. padding: 0,
  32. backgroundColor: colorBackgroundTab,
  33. borderTopWidth: 1, // line top
  34. borderTopColor: colorLine // color top line
  35. },
  36. indicatorStyle: {
  37. opacity: 1 // disable bottom line of android
  38. //borderBottomColor: "#353539",
  39. //borderBottomWidth: 2,
  40. },
  41. labelStyle: {
  42. fontSize: 10,
  43. margin: 0,
  44. padding: 0
  45. },
  46. iconStyle: {
  47. margin: 0,
  48. padding: 0
  49. },
  50. tabStyle: {
  51. margin: 0,
  52. padding: 0
  53. }
  54. },
  55. navigationOptions: {
  56. tabBarOnPress: ({ navigation, defaultHandler }) => {
  57. // perform your logic here
  58. // this is mandatory to perform the actual switch
  59. // don't call this if you want to prevent focus
  60. global.currentTab = navigation.state.key;
  61. defaultHandler();
  62. console.log('--------Current Tab ---------- ' + global.currentTab);
  63. }
  64. }
  65. };
  66. export default TabNavigatorConfig;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement