feat(web): add loading skeletons, error boundaries, and accessibility improvements
- Add segment-level loading.tsx for dashboard, search, admin, and auth routes - Add segment-level error.tsx with Vietnamese error messages for all route groups - Add skip-to-content navigation link in root layout - Add id="main-content" to all layout main elements - Add aria-label to nav elements and mobile menu buttons - Improve dashboard nav responsiveness (icon-only on mobile) - Hide user name on small screens in dashboard layout Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
40
apps/web/app/(auth)/loading.tsx
Normal file
40
apps/web/app/(auth)/loading.tsx
Normal file
@@ -0,0 +1,40 @@
|
||||
export default function AuthLoading() {
|
||||
return (
|
||||
<div className="rounded-lg border bg-card p-8 shadow-sm">
|
||||
<div className="space-y-6">
|
||||
{/* Logo / title skeleton */}
|
||||
<div className="text-center">
|
||||
<div className="mx-auto h-8 w-24 animate-pulse rounded bg-muted" />
|
||||
<div className="mx-auto mt-3 h-5 w-40 animate-pulse rounded bg-muted" />
|
||||
<div className="mx-auto mt-2 h-4 w-56 animate-pulse rounded bg-muted" />
|
||||
</div>
|
||||
|
||||
{/* Form fields skeleton */}
|
||||
<div className="space-y-4">
|
||||
<div>
|
||||
<div className="h-4 w-16 animate-pulse rounded bg-muted" />
|
||||
<div className="mt-2 h-10 w-full animate-pulse rounded-md bg-muted" />
|
||||
</div>
|
||||
<div>
|
||||
<div className="h-4 w-20 animate-pulse rounded bg-muted" />
|
||||
<div className="mt-2 h-10 w-full animate-pulse rounded-md bg-muted" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Submit button skeleton */}
|
||||
<div className="h-10 w-full animate-pulse rounded-md bg-muted" />
|
||||
|
||||
{/* OAuth buttons skeleton */}
|
||||
<div className="space-y-3">
|
||||
<div className="flex items-center gap-3">
|
||||
<div className="h-px flex-1 bg-muted" />
|
||||
<div className="h-3 w-12 animate-pulse rounded bg-muted" />
|
||||
<div className="h-px flex-1 bg-muted" />
|
||||
</div>
|
||||
<div className="h-10 w-full animate-pulse rounded-md bg-muted" />
|
||||
<div className="h-10 w-full animate-pulse rounded-md bg-muted" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user