summaryrefslogtreecommitdiff
path: root/app/(auth)/_layout.tsx
diff options
context:
space:
mode:
authorJustZvan <justzvan@justzvan.xyz>2026-02-06 13:22:33 +0100
committerJustZvan <justzvan@justzvan.xyz>2026-02-06 13:22:33 +0100
commit7eb8ccae48b0cc18a9dcaa9c3626a02df8e6d919 (patch)
tree57b7dd06ac9aa7053c671d916f7183e3b4fa9410 /app/(auth)/_layout.tsx
feat: initial commit!
Diffstat (limited to 'app/(auth)/_layout.tsx')
-rw-r--r--app/(auth)/_layout.tsx29
1 files changed, 29 insertions, 0 deletions
diff --git a/app/(auth)/_layout.tsx b/app/(auth)/_layout.tsx
new file mode 100644
index 0000000..e18b629
--- /dev/null
+++ b/app/(auth)/_layout.tsx
@@ -0,0 +1,29 @@
+import { Redirect, Stack } from "expo-router";
+import { useAuth } from "../../lib/auth";
+import { colors } from "../../lib/theme";
+import { LoadingScreen } from "../../lib/ui";
+
+export default function AuthLayout() {
+ const { isLoading, isAuthenticated } = useAuth();
+
+ if (isLoading) {
+ return <LoadingScreen />;
+ }
+
+ if (isAuthenticated) {
+ return <Redirect href="/(tabs)" />;
+ }
+
+ return (
+ <Stack
+ screenOptions={{
+ headerShown: false,
+ contentStyle: { backgroundColor: colors.background },
+ }}
+ >
+ <Stack.Screen name="welcome" />
+ <Stack.Screen name="signin" />
+ <Stack.Screen name="signup" />
+ </Stack>
+ );
+}