import { Redirect, Stack } from "expo-router";
import { useConvexAuth } from "convex/react";
import ActivityIndicatorScreen from "./sso-callback";
export default function AuthRoutesLayout(): React.ReactNode {
const { isAuthenticated, isLoading } = useConvexAuth();
if (isLoading) {
return <ActivityIndicatorScreen />;
}
if (isAuthenticated) {
return <Redirect href={"/"} />;
}
return (
<Stack>
<Stack.Screen
name="sign-in"
options={{
title: "",
headerTransparent: true,
}}
/>
<Stack.Screen
name="sign-up"
options={{
title: "",
headerTransparent: true,
}}
/>
<Stack.Screen name="sso-callback" options={{ headerShown: false }} />
</Stack>
);
}
import { Redirect, Stack } from "expo-router";
import { useConvexAuth } from "convex/react";
import ActivityIndicatorScreen from "./sso-callback";
export default function AuthRoutesLayout(): React.ReactNode {
const { isAuthenticated, isLoading } = useConvexAuth();
if (isLoading) {
return <ActivityIndicatorScreen />;
}
if (isAuthenticated) {
return <Redirect href={"/"} />;
}
return (
<Stack>
<Stack.Screen
name="sign-in"
options={{
title: "",
headerTransparent: true,
}}
/>
<Stack.Screen
name="sign-up"
options={{
title: "",
headerTransparent: true,
}}
/>
<Stack.Screen name="sso-callback" options={{ headerShown: false }} />
</Stack>
);
}