wavelength_app/app/_layout.tsx

28 lines
836 B
TypeScript
Raw Normal View History

import { Stack } from "expo-router";
import React, { useState } from "react";
import SignInScreen from "@/components/auth/SignInScreen";
import {
PushNotificationManager
} from "@/components/services/notifications/PushNotificationManager";
2024-10-18 12:39:54 -05:00
const RootLayout = () => {
const [isSignedIn, setIsSignedIn] = useState(false);
2024-10-18 12:39:54 -05:00
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>
);
}
2024-10-18 12:39:54 -05:00
export default RootLayout;