import { Tabs } from "expo-router/tabs"; import { StyleSheet } from "react-native"; import { FontAwesome } from "@expo/vector-icons"; import { Redirect } from "expo-router"; import React, { useEffect } from "react"; import { useThemeColor } from "../../hooks/useThemeColor"; import { useAuth } from "../contexts/AuthContext"; export default function Layout() { // const selectedColor: string = useThemeColor( "tabIconSelected"); // const defaultColor: string = useThemeColor("tabIconDefault"); // const backgroundColor: string = useThemeColor("backgroundColor"); // const tabBarColor: string = useThemeColor("tabBarColor"); const {authState} = useAuth() useEffect(()=>{ console.log(authState, "in root Layout") },[authState]) const styles = StyleSheet.create({ sceneContainer: { backgroundColor: useThemeColor("backgroundColor"), }, tabBar: { backgroundColor: useThemeColor("backgroundColor"), } }); const screenOptions = { tabBarActiveTintColor: useThemeColor( "tabIconSelected"), tabBarInactiveTintColor: useThemeColor("tabIconDefault"), headerShown: false, tabBarStyle: styles.tabBar, } if(!authState?.authenticated){ return ( ) } return ( ( ), } }/> ( ), unmountOnBlur: true, href: "(tabs)/home/" } }/> ( ), } }/> ); }