You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Mobile/app/(tabs)/_layout.tsx

79 lines
2.1 KiB

import { Redirect, Tabs } from "expo-router";
import { useSession } from "@/ctx";
import { Text } from "react-native";
import React from "react";
import {AntDesign, Ionicons, MaterialIcons} from "@expo/vector-icons";
export default function TabBarLayout() {
const { session, isLoading } = useSession();
const sizeIcon = 24;
// You can keep the splash screen open, or render a loading screen like we do here.
if (isLoading) {
return <Text>Loading...</Text>;
}
// Only require authentication within the (app) group's layout as users
// need to be able to access the (auth) group and sign in again.
/*if (!session) {
// On web, static rendering will stop here as the user is not authenticated
// in the headless Node process that the pages are rendered in.
return <Redirect href="/login" />;
}*/
return (
<Tabs
screenOptions={{
headerShown: false,
}}
>
<Tabs.Screen
name="(home)"
options={{
tabBarShowLabel: false,
tabBarIcon: () => <Ionicons name="home" size={sizeIcon} color="black" />,
}}
/>
<Tabs.Screen
name="(exercice)"
options={{
tabBarShowLabel: false,
tabBarIcon: () => <MaterialIcons name="fitness-center" size={sizeIcon} color="black" />,
}}
/>
<Tabs.Screen
name="(add)"
options={{
tabBarShowLabel: false,
tabBarIcon: () => <Ionicons name="add-circle-outline" size={sizeIcon} color="black" />,
}}
/>
<Tabs.Screen
name="(profil)"
options={{
tabBarShowLabel: false,
tabBarIcon: () => <MaterialIcons name="account-circle" size={sizeIcon} color="black" />,
}}
/>
<Tabs.Screen
name="(help)"
options={{
tabBarShowLabel: false,
tabBarIcon: () => <AntDesign name="question" size={sizeIcon} color="black" />,
}}
/>
</Tabs>
);
}