Advertisement
Guest User

Untitled

a guest
Nov 17th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.77 KB | None | 0 0
  1. const AuthStack = createStackNavigator(
  2. {
  3. Login: {
  4. screen: LoginScreen
  5. },
  6. Register: {
  7. screen: RegisterScreen
  8. }
  9. },
  10. {
  11. initialRouteName: 'Login',
  12. transitionConfig: (transitionProps) => ({
  13. containerStyle: {
  14. paddingBottom: transitionProps.index === 0 ? 0 : getBottomSpace()
  15. }
  16. }),
  17. }
  18. );
  19.  
  20. const HomeStack = createStackNavigator(
  21. {
  22. Home: {
  23. screen: HomeScreen,
  24. },
  25. PlayModes: {
  26. screen: PlayModesScreen,
  27. },
  28. PlayingMatch: {
  29. screen: PlayingMatchScreen,
  30. },
  31. Matching: {
  32. screen: MatchingScreen,
  33. },
  34. Matches: {
  35. screen: MatchesScreen,
  36. },
  37. },
  38. {
  39. initialRouteName: 'Home',
  40. transitionConfig: (transitionProps) => ({
  41. containerStyle: {
  42. paddingBottom: transitionProps.index === 0 ? 0 : getBottomSpace()
  43. }
  44. }),
  45. }
  46. );
  47.  
  48. const MainStack = createBottomTabNavigator(
  49. {
  50. Home: {
  51. screen: HomeStack,
  52. navigationOptions: {
  53. tabBarLabel: ({ focused }) => (
  54. <TabBarLabel title={'Home'}/>
  55. ),
  56. tabBarIcon: ({ focused }) => (
  57. <TabBarIcon src={images['home'].source} />
  58. ),
  59. // tabBarOnPress,
  60. }
  61. },
  62. Leaderboard: {
  63. screen: LeaderboardScreen,
  64. navigationOptions: {
  65. tabBarLabel: ({ focused }) => (
  66. <TabBarLabel title={'Leaderboard'}/>
  67. ),
  68. tabBarIcon: ({ focused }) => (
  69. <TabBarIcon src={images['ranking'].source} />
  70. ),
  71. // tabBarOnPress,
  72. }
  73. },
  74. },
  75. {
  76. initialRouteName: 'Home',
  77. tabBarOptions: {
  78. style: {
  79. margin: 0,
  80. padding: 0,
  81. backgroundColor: '#2e6eff',
  82. },
  83. /*indicatorStyle: {
  84. opacity: 1 // disable bottom line of android
  85. },
  86. labelStyle: {
  87. fontSize: 10,
  88. margin: 0,
  89. padding: 0
  90. },
  91. iconStyle: {
  92. margin: 0,
  93. padding: 0
  94. },
  95. tabStyle: {
  96. margin: 0,
  97. padding: 0
  98. }*/
  99. }
  100. }
  101. );
  102. const RootStack = createSwitchNavigator(
  103. {
  104. Auth: AuthStack,
  105. Main: MainStack,
  106. },
  107. {
  108. initialRouteName: 'Auth',
  109. }
  110. );
  111. const App = createAppContainer(RootStack);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement