Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import React from 'react';
- import { Platform, TouchableOpacity } from 'react-native';
- import { Ionicons } from '@expo/vector-icons';
- import { TabNavigator, TabBarBottom, DrawerNavigator } from 'react-navigation';
- import Colors from '../constants/Colors';
- import UserHome from '../screens/UserHome';
- import MapScreen from '../screens/MapScreen';
- import SettingsScreen from '../screens/SettingsScreen';
- import SideMenu from '../components/SideMenu';
- export const Tabs = TabNavigator(
- {
- Home: {
- screen: UserHome,
- },
- Map: {
- screen: MapScreen,
- },
- Settings: {
- screen: SettingsScreen,
- },
- },
- {
- navigationOptions: ({ navigation }) => ({
- tabBarIcon: ({ focused }) => {
- const { routeName } = navigation.state;
- let iconName;
- switch (routeName) {
- case 'Home':
- iconName =
- Platform.OS === 'ios'
- ? `ios-information-circle${focused ? '' : '-outline'}`
- : 'md-information-circle';
- break;
- case 'Map':
- iconName = Platform.OS === 'ios' ? `ios-link${focused ? '' : '-outline'}` : 'md-link';
- break;
- case 'Settings':
- iconName =
- Platform.OS === 'ios' ? `ios-options${focused ? '' : '-outline'}` : 'md-options';
- }
- return (
- <Ionicons
- name={iconName}
- size={28}
- style={{ marginBottom: -3, width: 25 }}
- color={focused ? Colors.tabIconSelected : Colors.tabIconDefault}
- />
- );
- },
- }),
- tabBarVisible: true,
- tabBarComponent: TabBarBottom,
- tabBarPosition: 'bottom',
- animationEnabled: false,
- swipeEnabled: false,
- }
- );
- export default DrawerNavigator({
- Tabs: {
- screen: Tabs,
- }
- }, {
- contentComponent: SideMenu,
- backBehavior: 'none'
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement