wavelength_app/app/_layout.tsx
2024-10-18 12:39:54 -05:00

28 lines
836 B
TypeScript

import { Stack } from "expo-router";
import React, { useState } from "react";
import SignInScreen from "@/components/auth/SignInScreen";
import {
PushNotificationManager
} from "@/components/services/notifications/PushNotificationManager";
const RootLayout = () => {
const [isSignedIn, setIsSignedIn] = useState(false);
console.log('RootLayout rendering, isSignedIn:', isSignedIn);
if (!isSignedIn) {
console.log('Rendering SignInScreen');
return (
<SignInScreen onSignIn={() => setIsSignedIn(true)} />
);
}
console.log('PushNotificationManager & Stack');
return (
<PushNotificationManager>
<Stack>
<Stack.Screen name="(tabs)" options={{ headerShown: false }} />
<Stack.Screen name="+not-found" />
</Stack>
</PushNotificationManager>
);
}
export default RootLayout;