This repository has been archived on 2024-11-20. You can view files and clone it, but cannot push or open issues or pull requests.
p61-project/app/authentication/_layout.tsx

52 lines
1.1 KiB
TypeScript
Raw Normal View History

import { Redirect, Tabs } from "expo-router"
import React from "react"
2024-05-02 01:08:27 +02:00
import { TabBarIcon } from "@/presentation/react-native/ui/TabBarIcon"
import { useAuthentication } from "@/presentation/react/contexts/Authentication"
const TabLayout: React.FC = () => {
const { user } = useAuthentication()
if (user != null) {
2024-03-23 01:43:27 +01:00
return <Redirect href="/application/habits/" />
}
return (
<Tabs
screenOptions={{
headerShown: false,
}}
>
2024-05-20 15:05:34 +02:00
<Tabs.Screen
name="about"
options={{
title: "About",
tabBarIcon: ({ color }) => {
return <TabBarIcon name="info" color={color} />
},
}}
/>
<Tabs.Screen
name="login"
options={{
title: "Login",
tabBarIcon: ({ color }) => {
return <TabBarIcon name="sign-in" color={color} />
},
}}
/>
<Tabs.Screen
name="register"
options={{
title: "Register",
tabBarIcon: ({ color }) => {
return <TabBarIcon name="user-plus" color={color} />
},
}}
/>
</Tabs>
)
}
export default TabLayout