feat(auth): redesign auth pages with glass UI and motion animations
- error page: replace Card with glass-strong panel, add AlertTriangle icon - signin page: add framer-motion entrance animation, CalendarDays branding, Loader2 spinner while loading, merge isPending/session checks - signout page: replace Card with glass-strong panel, add LogOut icon, tighten user identity display
This commit is contained in:
@@ -1,17 +1,12 @@
|
||||
"use client";
|
||||
|
||||
import { motion } from "framer-motion";
|
||||
import { CalendarDays, Loader2 } from "lucide-react";
|
||||
import Link from "next/link";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useEffect, useState } from "react";
|
||||
import { toast } from "sonner";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import {
|
||||
Card,
|
||||
CardContent,
|
||||
CardDescription,
|
||||
CardHeader,
|
||||
CardTitle,
|
||||
} from "@/components/ui/card";
|
||||
import { signIn, useSession } from "@/lib/auth-client";
|
||||
|
||||
export default function SignInPage() {
|
||||
@@ -39,43 +34,46 @@ export default function SignInPage() {
|
||||
}
|
||||
};
|
||||
|
||||
if (isPending) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (session?.user) {
|
||||
if (isPending || session?.user) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="min-h-screen flex items-center justify-center bg-background p-4">
|
||||
<Card className="w-full max-w-md">
|
||||
<CardHeader className="text-center">
|
||||
<CardTitle className="text-2xl font-bold">Welcome</CardTitle>
|
||||
<CardDescription>
|
||||
Sign in to access AI-powered calendar features
|
||||
</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent className="space-y-4">
|
||||
<Button
|
||||
onClick={handleSignIn}
|
||||
className="w-full"
|
||||
size="lg"
|
||||
disabled={isLoading}
|
||||
>
|
||||
{isLoading ? "Signing in..." : "Continue with Authentik"}
|
||||
</Button>
|
||||
<div className="min-h-screen flex items-center justify-center p-4">
|
||||
<motion.div
|
||||
initial={{ opacity: 0, y: 16 }}
|
||||
animate={{ opacity: 1, y: 0 }}
|
||||
transition={{ duration: 0.3 }}
|
||||
className="glass-strong p-8 max-w-sm w-full text-center"
|
||||
>
|
||||
<div className="flex items-center justify-center gap-2 mb-6">
|
||||
<CalendarDays className="h-6 w-6 text-primary" />
|
||||
<h1 className="text-xl font-semibold tracking-tight">Local iCal</h1>
|
||||
</div>
|
||||
|
||||
<div className="text-center">
|
||||
<Link
|
||||
href="/"
|
||||
className="text-sm text-muted-foreground hover:underline"
|
||||
>
|
||||
Continue without signing in
|
||||
</Link>
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
<p className="text-sm text-muted-foreground mb-6">
|
||||
Sign in to unlock AI-powered event creation
|
||||
</p>
|
||||
|
||||
<Button
|
||||
onClick={handleSignIn}
|
||||
className="w-full"
|
||||
size="default"
|
||||
disabled={isLoading}
|
||||
>
|
||||
{isLoading ? <Loader2 className="h-4 w-4 animate-spin mr-2" /> : null}
|
||||
{isLoading ? "Signing in..." : "Continue with Authentik"}
|
||||
</Button>
|
||||
|
||||
<div className="mt-4">
|
||||
<Link
|
||||
href="/"
|
||||
className="text-xs text-muted-foreground hover:text-foreground transition-colors"
|
||||
>
|
||||
Continue without signing in
|
||||
</Link>
|
||||
</div>
|
||||
</motion.div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user