import React from 'react'; import { TouchableOpacity, Text, View, Image, } from 'react-native'; import { createStackNavigator, createAppContainer, createSwitchNavigator, createBottomTabNavigator, HeaderBackButton } from 'react-navigation'; import * as Screens from './screens'; /*Icons*/ import Icon from "react-native-vector-icons/Ionicons" import IconF from "react-native-vector-icons/Foundation" import IconFA from "react-native-vector-icons/FontAwesome5" import AuthLoadingScreen from './screens/AuthLoading' import Eventos from './screens/Eventos' import Jogo from './screens/Jogo' import Scan from './screens/Scan' import Calendar from './screens/Calendar' import Home from './screens/Home' import Profile from "./screens/Profile"; import editCalendar from './screens/editCalendar'; import choosePath from './screens/choosePath'; import calendarDetail from './screens/calendarDetail'; //import resetPassword from './screens/resetPassword'; import eventDetail from './screens/eventDetail'; import teamDetail from './screens/teamDetail'; import event from './screens/event'; import map from './screens/map' const navigationOptions = ({navigation}) => ({ headerLeft: navigation.goBack(null)}/>, headerStyle: {backgroundColor: 'transparent', zIndex: 100 }, }); const AppStack = createBottomTabNavigator( { Calendário: { screen: Calendar, navigationOptions: { tabBarIcon: ({tintColor}) => ( ) }, }, Mapa:{ screen: map, navigationOptions: { tabBarIcon: ({tintColor}) => ( ) }, }, 'Jogo': { screen: Jogo, navigationOptions: { tabBarIcon: ({tintColor}) => ( ) }, }, Scan: { screen: Scan, navigationOptions: { tabBarIcon: ({tintColor}) => ( ), }, }, Atividades: { screen: Eventos, navigationOptions: { tabBarIcon: ({tintColor}) => ( ) }, }, Home: { screen: Home, navigationOptions: { tabBarIcon: ({tintColor}) => ( ) }, }, }, { initialRouteName: 'Home', tabBarOptions: { showLabel: true, // hide labels activeTintColor: '#CC1A17', // active icon color inactiveTintColor: 'black', // inactive icon color style: { backgroundColor: '#fff' // TabBar background } } } ); const Stack = createStackNavigator({ tabs: { screen: AppStack, navigationOptions: ({navigation}) => { const index = navigation.state.index; if (navigation.state.routes[index].routeName == 'Home') { return { headerTitle: `${navigation.state.routes[index].routeName}`, headerRight: ( navigation.navigate('Profile')}> Editar dados ) } } if (navigation.state.routes[index].routeName == 'Jogo') { return { headerTitle: (Jogo do ENEI'19) } } else if (navigation.state.routes[index].routeName == 'Calendário') { return { headerTitle: 'Calendário', headerRight: ( navigation.navigate('choosePath')}> Inscrições ) } } else if (navigation.state.routes[index].routeName == 'choosePath') { return { headerTitle: 'Calendário', headerRight: ( navigation.navigate('Edit')}> FAQ navigation.navigate('choosePath')}> Escolher ) } } else if (navigation.state.routes[index].routeName == 'Atividades') { return { headerTitle: 'Atividades', } } else if (navigation.state.routes[index].routeName == 'Mapa') { return { headerTitle: 'Mapa do Evento', } } else { return { header: null } } } }, Profile: { screen: Profile }, Edit: { screen: editCalendar }, choosePath: { screen: choosePath }, calendarDetail: { screen: calendarDetail, }, eventDetail: { screen: eventDetail, }, teamDetail:{ screen: teamDetail, }, event:{ screen: event } }); export default createAppContainer(createSwitchNavigator( { AuthLoading: AuthLoadingScreen, App: Stack, }, { initialRouteName: 'App' }) );