feat: add frontend auth shell

This commit is contained in:
hailin
2026-07-01 14:15:26 +08:00
parent 953f126277
commit 4925285cf3
12 changed files with 664 additions and 40 deletions

View File

@@ -1,7 +1,37 @@
import { AppShell } from './layout/AppShell'
import { Router } from './router'
import { AuthProvider, useAuth } from '@/features/auth/AuthProvider'
import { LoginPage } from '@/features/auth/LoginPage'
import { Skeleton } from '@/components/ui/skeleton'
export function App() {
return (
<AuthProvider>
<AppContent />
</AuthProvider>
)
}
function AppContent() {
const { authenticated, loading } = useAuth()
if (loading) {
return (
<main className="flex min-h-screen items-center justify-center bg-background px-5">
<div className="grid w-full max-w-[420px] gap-3">
<Skeleton className="h-9 w-44" />
<Skeleton className="h-4 w-full" />
<Skeleton className="h-4 w-3/4" />
<Skeleton className="mt-4 h-48 w-full" />
</div>
</main>
)
}
if (!authenticated) {
return <LoginPage />
}
return (
<AppShell>
<Router />