Advertisement
Guest User

routes

a guest
Oct 16th, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.88 KB | None | 0 0
  1. import React, { Component } from 'react';
  2. import { createAppContainer } from 'react-navigation';
  3. import { createStackNavigator } from 'react-navigation-stack';
  4. import { createBottomTabNavigator } from 'react-navigation-tabs';
  5. import { Provider } from 'react-redux';
  6. import { createStore, applyMiddleware } from 'redux';
  7. import ReduxThunk from 'redux-thunk';
  8. import Icon from 'react-native-vector-icons/FontAwesome';
  9. import IconT from 'react-native-vector-icons/FontAwesome5';
  10. import IconO from 'react-native-vector-icons/Entypo';
  11.  
  12.  
  13. import Reactotron from "./Config/ReactotronConfig";
  14. import Reducers from '../Reducers';
  15.  
  16. import "./components/sidebar";
  17. import HeaderComponent from './components/Header/Header';
  18.  
  19. import Inicio from './pages/Inicio/Inicio';
  20. import ShowNews from './pages/ShowNews/ShowNews';
  21. import NoticiaView from './pages/NoticiaView/NoticiaView';
  22. import facebookAccess from './pages/Home/facebookAccess/facebookAccess';
  23. import youtubeAccess from './pages/Home/youtubeAccess/youtubeAccess';
  24. import instagramAccess from './pages/Home/instagramAccess/instagramAccess';
  25. import Onibus from './pages/Onibus/Onibus';
  26. import Cinema from './pages/Cinema/Cinema';
  27. import AutoresNews from './pages/AutoresNews/AutoresNews';
  28. import Eventos from './pages/Eventos/Eventos';
  29. import Home from './pages/Home/Home';
  30. import AllNews from './pages/AllNews/AllNews';
  31. import Guia from "./pages/Guia/Guia";
  32. import ClubeOn from "./pages/ClubeOn/ClubeOn";
  33. import Radio from './pages/Radio/Radio';
  34. import Autor from './pages/Autor/Autor';
  35. import Utilidades from './pages/Utilidades/Utilidades';
  36.  
  37. const store = createStore( Reducers, Reactotron, applyMiddleware(ReduxThunk));
  38.  
  39. const Bottom = createBottomTabNavigator(
  40. {
  41. Home:{
  42. screen: Home,
  43. navigationOptions: {
  44. tabBarIcon: ({ focused, tintColor }) => (
  45. <Icon name={focused ? 'home' : 'home'} size={25} style = {{ color: tintColor }}/>
  46. )
  47. },
  48. },
  49. Autor: {
  50. screen: Autor,
  51. navigationOptions: {
  52. tabBarIcon: ({ focused, tintColor }) => (
  53. <IconO name={focused ? 'users' : 'users'} size={25} style = {{ color: tintColor }}/>
  54. )
  55. },
  56. },
  57. Guia: {
  58. screen: Guia,
  59. navigationOptions: {
  60. tabBarIcon: ({ focused, tintColor }) => (
  61. <IconT name={focused ? 'search-location' : 'search-location'} size={25} style = {{ color: tintColor }}/>
  62. )
  63. },
  64. },
  65. ClubeOn: {
  66. screen: ClubeOn,
  67. navigationOptions: {
  68. tabBarIcon: ({ focused, tintColor }) => (
  69. <IconT name={focused ? 'gifts' : 'gifts'} size={25} style = {{ color: tintColor }}/>
  70. )
  71. },
  72. },
  73. Radio: {
  74. screen: Radio,
  75. navigationOptions: {
  76. tabBarIcon: ({ focused, tintColor }) => (
  77. <IconT name={focused ? 'broadcast-tower' : 'broadcast-tower'} size={25} style = {{ color: tintColor }}/>
  78. )
  79. },
  80. },
  81.  
  82. Utilidades: {
  83. screen: Utilidades,
  84. navigationOptions: {
  85. tabBarIcon: ({ focused, tintColor }) => (
  86. <IconT name={focused ? 'star' : 'star'} size={25} style = {{ color: tintColor }}/>
  87. )
  88. },
  89. }
  90. },
  91. {
  92. tabBarOptions: {
  93. showIcon: true,
  94. showLabel: false,
  95. activeTintColor: '#009Fe3',
  96. inactiveTintColor: '#646464',
  97. style: {
  98. backgroundColor: "#EEE",
  99. borderTopWidth: 0,
  100. elevation: 0,
  101. },
  102. },
  103. },
  104. {
  105. headerLayoutPreset: 'center',
  106. },
  107. );
  108.  
  109. const Routes = createStackNavigator(
  110. {
  111. Inicio: {
  112. screen:Inicio,
  113. navigationOptions: {
  114. header: null,
  115. },
  116. },
  117. Bottom:{
  118. screen:Bottom,
  119. navigationOptions: HeaderComponent,
  120. },
  121. ShowNews:{
  122. screen:ShowNews,
  123. navigationOptions: HeaderComponent,
  124. },
  125. NoticiaView:{
  126. screen:NoticiaView,
  127. navigationOptions: HeaderComponent,
  128. },
  129. AllNews: {
  130. screen: AllNews,
  131. navigationOptions: HeaderComponent,
  132. },
  133. AutoresNews:{
  134. screen: AutoresNews,
  135. navigationOptions: HeaderComponent,
  136. },
  137. facebookAccess:{
  138. screen:facebookAccess,
  139. navigationOptions: HeaderComponent,
  140. },
  141. instagramAccess:{
  142. screen:instagramAccess,
  143. navigationOptions: HeaderComponent,
  144. },
  145. youtubeAccess: {
  146. screen: youtubeAccess,
  147. navigationOptions: HeaderComponent,
  148. },
  149. Onibus: {
  150. screen: Onibus,
  151. navigationOptions: HeaderComponent,
  152. },
  153. Cinema: {
  154. screen: Cinema,
  155. navigationOptions: HeaderComponent,
  156. },
  157. Eventos: {
  158. screen: Eventos,
  159. navigationOptions: HeaderComponent,
  160. }
  161. },
  162. {
  163. headerLayoutPreset: 'center',
  164. },
  165. );
  166.  
  167. const Pages = createAppContainer(Routes);
  168.  
  169. export default class routes extends Component {
  170. render() {
  171. return (
  172. <Provider store={store}>
  173. <Pages />
  174. </Provider>
  175. );
  176. }
  177. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement