Last active
July 21, 2022 08:53
-
-
Save happyharis/d6599ce93564ef53723b03280c3c9c68 to your computer and use it in GitHub Desktop.
PCMOB6 HomeStack.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { FontAwesome } from "@expo/vector-icons"; | |
import { createBottomTabNavigator } from "@react-navigation/bottom-tabs"; | |
import React from "react"; | |
import { NOTES_SCREEN, PROFILE_SCREEN } from "../constants"; | |
import NotesScreenHome from "../screens/NotesScreenHome"; | |
import ProfileScreen from "../screens/ProfileScreen"; | |
const BottomTab = createBottomTabNavigator(); | |
export default function HomeStack() { | |
return ( | |
<BottomTab.Navigator | |
screenOptions={({ route }) => ({ | |
headerShown: false, | |
tabBarActiveTintColor: "black", | |
tabBarShowLabel: false, | |
tabBarIcon: ({ color, size }) => { | |
let iconName; | |
if (route.name == NOTES_SCREEN.Home) iconName = "list-alt"; | |
else iconName = "user"; | |
return <FontAwesome name={iconName} size={size} color={color} />; | |
}, | |
})} | |
> | |
<BottomTab.Screen name={NOTES_SCREEN.Home} component={NotesScreenHome} /> | |
<BottomTab.Screen name={PROFILE_SCREEN} component={ProfileScreen} /> | |
</BottomTab.Navigator> | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment