Skip to content

Instantly share code, notes, and snippets.

@happyharis
Last active July 21, 2022 08:53
Show Gist options
  • Save happyharis/d6599ce93564ef53723b03280c3c9c68 to your computer and use it in GitHub Desktop.
Save happyharis/d6599ce93564ef53723b03280c3c9c68 to your computer and use it in GitHub Desktop.
PCMOB6 HomeStack.js
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