import { Stack } from "expo-router"
import * as SplashScreen from "expo-splash-screen"
import {
MD3LightTheme as DefaultTheme,
PaperProvider,
} from "react-native-paper"
import { StatusBar } from "expo-status-bar"
import { useEffect } from "react"
import { HabitsTrackerProvider } from "@/presentation/react/contexts/HabitsTracker"
import {
AuthenticationProvider,
useAuthentication,
} from "@/presentation/react/contexts/Authentication"
export { ErrorBoundary } from "expo-router"
export const unstableSettings = {
initialRouteName: "index",
}
SplashScreen.preventAutoHideAsync().catch((error) => {
console.error(error)
})
const StackLayout: React.FC = () => {
const { hasLoaded } = useAuthentication()
useEffect(() => {
if (!hasLoaded) {
SplashScreen.hideAsync().catch((error) => {
console.error(error)
})
}
}, [hasLoaded])
if (hasLoaded) {
return <>>
}
return (
)
}
const RootLayout: React.FC = () => {
return (
)
}
export default RootLayout