Advertisement
douglaswilliamn

Untitled

Oct 20th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 'use strict'
  2.  
  3. import React, { Component } from 'react';
  4. import { Platform } from 'react-native';
  5.  
  6. import { createMaterialBottomTabNavigator } from "react-navigation-material-bottom-tabs";
  7. import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
  8. import IconFont from 'react-native-vector-icons/FontAwesome';
  9.  
  10. import ProfileScreen from "../screens/Profile";
  11. import InicialPublishScreen from "../screens/InicialPublish";
  12. import GoogleMapsScreen from "../screens/GoogleMaps";
  13. import Colors from "../constants/Colors";
  14.  
  15. export default createMaterialBottomTabNavigator(
  16.     {
  17.         Home: {
  18.             screen: GoogleMapsScreen,
  19.             navigationOptions: {
  20.                 tabBarLabel: '',
  21.                 tabBarIcon: ({ focused }) => (
  22.                     <Icon
  23.                         size={24}
  24.                         name={ Platform.OS === 'ios' ? (focused ? 'home' : 'home-outline') : (focused ? 'home' : 'home-outline') }
  25.                         style={{ color: Colors.Black }} />
  26.                 )
  27.             }
  28.         },
  29.         Publicação: {
  30.             screen: InicialPublishScreen,
  31.             navigationOptions: {
  32.                 tabBarIcon: ({ focused }) => (
  33.                     <Icon
  34.                         size={24}
  35.                         name={ Platform.OS === 'ios' ? (focused ? 'camera' : 'camera-outline') : (focused ? 'camera' : 'camera-outline') }
  36.                         style={{ color: Colors.Black }} />
  37.                 )
  38.             }
  39.         },
  40.         Perfil: {
  41.             screen: ProfileScreen,
  42.             navigationOptions: {
  43.                 tabBarIcon: ({ focused }) => (
  44.                     <IconFont
  45.                         size={24}
  46.                         name={ Platform.OS === 'ios' ? (focused ? 'user' : 'user-o') : (focused ? 'user' : 'user-o') }
  47.                         style={{ color: Colors.Black }} />
  48.                 )
  49.             }
  50.         },
  51.     },
  52.     {
  53.         initialRouteName: 'Home',
  54.         labeled: '',
  55.         activeColor: Colors.Black,
  56.         inactiveColor: Colors.GrayDivider,
  57.         barStyle: {
  58.             backgroundColor: Colors.White
  59.         },
  60.     }
  61. );
  62.  
  63. // Dependência
  64. yarn add react-navigation-material-bottom-tabs  ( opcional -> react-native-paper )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement