feat: Expo scaffold + auth screens + core screens (#39-#46, #48)

This commit is contained in:
Nemo
2026-03-23 18:40:04 +08:00
commit 745321e5bd
45 changed files with 10557 additions and 0 deletions

31
app/_layout.tsx Normal file
View File

@@ -0,0 +1,31 @@
import '../global.css';
import { useEffect } from 'react';
import { Stack, router } from 'expo-router';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { useAuthStore } from '../stores/authStore';
const queryClient = new QueryClient();
export default function RootLayout() {
const { hydrate, token, isLoading } = useAuthStore();
useEffect(() => {
hydrate();
}, []);
useEffect(() => {
if (!isLoading) {
if (token) {
router.replace('/(app)/dashboard');
} else {
router.replace('/(auth)/company-code');
}
}
}, [isLoading, token]);
return (
<QueryClientProvider client={queryClient}>
<Stack screenOptions={{ headerShown: false }} />
</QueryClientProvider>
);
}