Skip to content

Instantly share code, notes, and snippets.

@pau-riosa
Created April 27, 2020 15:51
Show Gist options
  • Save pau-riosa/02266a3e862d34eff33608fd3b7c9477 to your computer and use it in GitHub Desktop.
Save pau-riosa/02266a3e862d34eff33608fd3b7c9477 to your computer and use it in GitHub Desktop.
import * as React from 'react';
import { StyleSheet, View, Text } from 'react-native';
import { Button, Icon } from 'react-native-elements'
// Screens
import DashboardScreen from '../screens/Root/DashboardScreen';
// colors
import {colors} from '../assets'
// navigation
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
const BottomTab = createBottomTabNavigator();
export default function Root() {
return (
<BottomTab.Navigator
initialRouteName="DASHBOARD"
tabBarOptions={{
activeTintColor: colors.ocean1,
inactiveTintColor: colors.primaryGrey,
}}
>
<BottomTab.Screen
name="DASHBOARD"
component={DashboardScreen}
options={{
tabBarLabel: 'Home',
tabBarIcon: ({color, size}) => (
<Icon
name='home'
size={size}
type='feather'
color={color}
/>
)
}}
/>
<BottomTab.Screen
name="MESSAGES"
component={DashboardScreen}
options={{
tabBarLabel: 'Messages',
tabBarIcon: ({color, size}) => (
<View style={{ width: 24, height: 24, margin: 5 }}>
<Icon name='mail' size={size} type='feather' color={color} />
<View
style={{
position: 'absolute',
right: -6,
top: -3,
backgroundColor: colors.primaryBlue,
borderRadius: 10,
width: 15,
height: 15,
justifyContent: 'center',
alignItems: 'center',
}}
>
</View>
</View>
)
}}
/>
<BottomTab.Screen
name="NEW PATIENT"
headerShown={'false'}
component={DashboardScreen}
options={{
tabBarButton: ({color, size}) => (
<Button
icon={
<Icon
name="plus"
type='font-awesome'
size={25}
color="white"
/>
}
buttonStyle={styles.buttonStyle}
/>
)
}}
/>
<BottomTab.Screen
name="CALENDAR"
component={DashboardScreen}
options={{
tabBarLabel: 'Calendar',
tabBarIcon: ({color, size}) => (
<Icon
name='calendar'
size={size}
type='feather'
color={color}
/>
)
}}
/>
<BottomTab.Screen
name="SETTINGS"
component={DashboardScreen}
options={{
tabBarLabel: 'Settings',
tabBarIcon: ({color, size}) => (
<Icon
name='settings'
size={size}
type='feather'
color={color}
/>
)
}}
/>
</BottomTab.Navigator>
)
};
const styles = StyleSheet.create({
buttonStyle: {
height: 90,
width: 90,
bottom: 45,
backgroundColor: colors.primaryBlue,
borderRadius: 100,
borderColor: colors.ocean1,
borderWidth: 5
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment