import "../tamagui-web.css"
import { useEffect } from 'react'
import { ToastWrapper } from './../components/toastwrapper'
import { StatusBar, useColorScheme } from 'react-native'
import { DarkTheme, DefaultTheme, ThemeProvider } from '@react-navigation/native'
import { useFonts } from 'expo-font'
import { SplashScreen, Stack, Slot } from 'expo-router'
import { Provider } from './Provider'
import { useTheme, Button, Anchor, XStack } from 'tamagui'
import { ArrowLeft, ArrowRight } from '@tamagui/lucide-icons';
import {useAuth,AuthProvider} from "contexts/authcontext"
import { useRouter } from 'expo-router'
import { Platform } from 'react-native';
export {
// Catch any errors thrown by the Layout component.
ErrorBoundary,
} from 'expo-router'
export const unstable_settings = {
// Ensure that reloading on `/modal` keeps a back button present.
initialRouteName: '(tabs)',
}
// Prevent the splash screen from auto-hiding before asset loading is complete.
SplashScreen.preventAutoHideAsync()
export default function RootLayout() {
const [interLoaded, interError] = useFonts({
Inter: require('@tamagui/font-inter/otf/Inter-Medium.otf'),
InterBold: require('@tamagui/font-inter/otf/Inter-Bold.otf'),
})
useEffect(() => {
const intervalId = setInterval(() => {
console.log("test")
}, 10000)
return () => clearInterval(intervalId)
}, [])
useEffect(() => {
if (interLoaded || interError) {
// Hide the splash screen after the fonts have loaded (or an error was returned) and the UI is ready.
SplashScreen.hideAsync()
}
}, [interLoaded, interError])
if (!interLoaded && !interError) {
return null
}
return (
<>
>
)
}
const Providers = ({ children }: { children: React.ReactNode }) => {
return {children}
}
function RootLayoutNav() {
const {isLoggedIn, logout,} = useAuth()
const colorScheme = useColorScheme()
const theme = useTheme()
const router = useRouter()
return (
(
),
headerRight: () => (
!isLoggedIn ? (
):()
),
}}
>
)
}