feat: unauthenticated tab

This commit is contained in:
2025-11-05 10:58:34 +01:00
parent 8180e0b375
commit e8db8d1654
15 changed files with 229 additions and 58 deletions
+6
View File
@@ -1,6 +1,7 @@
import { Motion } from "@legendapp/motion";
import { createBottomTabNavigator } from "@react-navigation/bottom-tabs";
import React from "reactn";
import { useGlobal } from "reactn";
import { Palette } from "../styles";
import { Routes } from "./Routes";
import { tabs } from "../assets";
@@ -15,6 +16,9 @@ import HomeStack from "./HomeStack";
const BottomTab = createBottomTabNavigator();
export const BottomTabScreen = () => {
const [currentUID] = useGlobal("currentUID");
const isAuthenticated = !!currentUID;
const renderIcon = (icon, focused) => (
<Motion.Image
resizeMode={"contain"}
@@ -72,6 +76,7 @@ export const BottomTabScreen = () => {
headerShown: false,
tabBarShowLabel: true,
tabBarIcon: ({ focused }) => renderIcon(tabs.albums, focused),
hide: !isAuthenticated,
}}
/>
<BottomTab.Screen
@@ -83,6 +88,7 @@ export const BottomTabScreen = () => {
headerShown: false,
tabBarShowLabel: true,
tabBarIcon: ({ focused }) => renderIcon(tabs.person, focused),
hide: !isAuthenticated,
}}
/>
</BottomTab.Navigator>