2024-02-16 22:51:50 +01:00
|
|
|
import FontAwesome from "@expo/vector-icons/FontAwesome"
|
|
|
|
import { Tabs } from "expo-router"
|
|
|
|
import React from "react"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @see https://icons.expo.fyi/
|
|
|
|
* @param props
|
|
|
|
* @returns
|
|
|
|
*/
|
|
|
|
const TabBarIcon: React.FC<{
|
|
|
|
name: React.ComponentProps<typeof FontAwesome>["name"]
|
|
|
|
color: string
|
|
|
|
}> = (props) => {
|
|
|
|
return <FontAwesome size={28} style={{ marginBottom: -3 }} {...props} />
|
|
|
|
}
|
|
|
|
|
|
|
|
const TabLayout: React.FC = () => {
|
|
|
|
return (
|
|
|
|
<Tabs
|
|
|
|
screenOptions={{
|
|
|
|
headerShown: false,
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
<Tabs.Screen
|
|
|
|
name="index"
|
|
|
|
options={{
|
|
|
|
title: "Home",
|
|
|
|
tabBarIcon: ({ color }) => {
|
|
|
|
return <TabBarIcon name="home" color={color} />
|
|
|
|
},
|
|
|
|
}}
|
|
|
|
/>
|
2024-03-15 14:19:58 +01:00
|
|
|
<Tabs.Screen
|
2024-03-15 23:24:08 +01:00
|
|
|
name="habits/new"
|
2024-03-15 14:19:58 +01:00
|
|
|
options={{
|
|
|
|
title: "New Habit",
|
|
|
|
tabBarIcon: ({ color }) => {
|
|
|
|
return <TabBarIcon name="plus-square" color={color} />
|
|
|
|
},
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
<Tabs.Screen
|
2024-03-15 23:24:08 +01:00
|
|
|
name="habits/index"
|
|
|
|
options={{
|
|
|
|
headerShown: false,
|
|
|
|
title: "Habits",
|
|
|
|
tabBarIcon: ({ color }) => {
|
|
|
|
return <TabBarIcon name="sticky-note" color={color} />
|
|
|
|
},
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
<Tabs.Screen
|
|
|
|
name="habits/history"
|
2024-03-15 14:19:58 +01:00
|
|
|
options={{
|
|
|
|
title: "History",
|
|
|
|
tabBarIcon: ({ color }) => {
|
|
|
|
return <TabBarIcon name="history" color={color} />
|
|
|
|
},
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
<Tabs.Screen
|
2024-03-15 23:24:08 +01:00
|
|
|
name="users/settings"
|
2024-03-15 14:19:58 +01:00
|
|
|
options={{
|
|
|
|
title: "Settings",
|
|
|
|
tabBarIcon: ({ color }) => {
|
|
|
|
return <TabBarIcon name="cog" color={color} />
|
|
|
|
},
|
|
|
|
}}
|
|
|
|
/>
|
2024-03-15 12:34:53 +01:00
|
|
|
<Tabs.Screen
|
2024-03-15 23:24:08 +01:00
|
|
|
name="authentication/login"
|
2024-03-15 12:34:53 +01:00
|
|
|
options={{
|
|
|
|
title: "Login",
|
|
|
|
tabBarIcon: ({ color }) => {
|
|
|
|
return <TabBarIcon name="sign-in" color={color} />
|
|
|
|
},
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
<Tabs.Screen
|
2024-03-15 23:24:08 +01:00
|
|
|
name="authentication/register"
|
2024-03-15 12:34:53 +01:00
|
|
|
options={{
|
|
|
|
title: "Register",
|
|
|
|
tabBarIcon: ({ color }) => {
|
|
|
|
return <TabBarIcon name="user-plus" color={color} />
|
|
|
|
},
|
|
|
|
}}
|
|
|
|
/>
|
2024-02-16 22:51:50 +01:00
|
|
|
</Tabs>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
export default TabLayout
|