|
1 | 1 | import { useState } from 'react' |
2 | 2 | import { useAuth } from '@/contexts/AuthContext' |
3 | 3 | import { useNavigate, Link } from 'react-router-dom' |
| 4 | +import { motion } from 'framer-motion' |
4 | 5 | import { Button } from '@/components/ui/button' |
5 | 6 | import { Input } from '@/components/ui/input' |
6 | 7 | import { Label } from '@/components/ui/label' |
7 | 8 | import { Alert, AlertDescription } from '@/components/ui/alert' |
8 | 9 | import { Navbar } from '@/components/landing' |
9 | | -import { Github, Loader2, Mail, Lock, CheckCircle2 } from 'lucide-react' |
| 10 | +import { Github, Loader2, Mail, Lock, CheckCircle2, Send, ArrowLeft } from 'lucide-react' |
10 | 11 |
|
11 | 12 | export function SignupForm() { |
12 | 13 | const [email, setEmail] = useState('') |
@@ -76,38 +77,104 @@ export function SignupForm() { |
76 | 77 | <div className="w-full max-w-sm"> |
77 | 78 | {/* Email Verification Sent */} |
78 | 79 | {emailSent ? ( |
79 | | - <div className="text-center"> |
80 | | - <div className="w-16 h-16 mx-auto mb-6 rounded-full bg-green-500/10 border border-green-500/20 flex items-center justify-center"> |
81 | | - <CheckCircle2 className="w-8 h-8 text-green-500" /> |
82 | | - </div> |
83 | | - <h1 className="text-2xl font-semibold text-foreground mb-2"> |
84 | | - Check your email |
85 | | - </h1> |
86 | | - <p className="text-sm text-muted-foreground mb-6"> |
87 | | - We sent a verification link to<br /> |
88 | | - <span className="font-medium text-foreground">{email}</span> |
89 | | - </p> |
90 | | - <div className="bg-card rounded-lg border border-border p-4 text-sm text-muted-foreground"> |
91 | | - <p className="mb-2"> |
92 | | - Click the link in the email to verify your account and get started. |
93 | | - </p> |
94 | | - <p> |
95 | | - Didn't receive it? Check your spam folder or{' '} |
96 | | - <button |
97 | | - onClick={() => setEmailSent(false)} |
98 | | - className="text-primary hover:underline" |
| 80 | + <motion.div |
| 81 | + initial={{ opacity: 0, y: 20 }} |
| 82 | + animate={{ opacity: 1, y: 0 }} |
| 83 | + className="text-center" |
| 84 | + > |
| 85 | + {/* Animated Icon */} |
| 86 | + <div className="relative w-24 h-24 mx-auto mb-8"> |
| 87 | + {/* Outer glow ring */} |
| 88 | + <motion.div |
| 89 | + initial={{ scale: 0.8, opacity: 0 }} |
| 90 | + animate={{ scale: 1, opacity: 1 }} |
| 91 | + transition={{ delay: 0.2, duration: 0.5 }} |
| 92 | + className="absolute inset-0 rounded-full bg-gradient-to-r from-primary/20 to-purple-500/20 blur-xl" |
| 93 | + /> |
| 94 | + {/* Icon container */} |
| 95 | + <motion.div |
| 96 | + initial={{ scale: 0 }} |
| 97 | + animate={{ scale: 1 }} |
| 98 | + transition={{ type: "spring", stiffness: 200, damping: 15, delay: 0.1 }} |
| 99 | + className="relative w-24 h-24 rounded-full bg-gradient-to-br from-primary/10 to-purple-500/10 border border-primary/30 flex items-center justify-center" |
| 100 | + > |
| 101 | + <motion.div |
| 102 | + initial={{ scale: 0, rotate: -180 }} |
| 103 | + animate={{ scale: 1, rotate: 0 }} |
| 104 | + transition={{ type: "spring", stiffness: 200, damping: 12, delay: 0.3 }} |
99 | 105 | > |
100 | | - try again |
101 | | - </button> |
102 | | - </p> |
| 106 | + <Send className="w-10 h-10 text-primary" /> |
| 107 | + </motion.div> |
| 108 | + </motion.div> |
103 | 109 | </div> |
104 | | - <Link |
105 | | - to="/login" |
106 | | - className="inline-block mt-6 text-sm text-muted-foreground hover:text-foreground" |
| 110 | + |
| 111 | + {/* Title */} |
| 112 | + <motion.h1 |
| 113 | + initial={{ opacity: 0, y: 10 }} |
| 114 | + animate={{ opacity: 1, y: 0 }} |
| 115 | + transition={{ delay: 0.4 }} |
| 116 | + className="text-3xl font-bold text-foreground mb-3" |
107 | 117 | > |
108 | | - ← Back to login |
109 | | - </Link> |
110 | | - </div> |
| 118 | + Check your inbox |
| 119 | + </motion.h1> |
| 120 | + |
| 121 | + {/* Email display */} |
| 122 | + <motion.div |
| 123 | + initial={{ opacity: 0, y: 10 }} |
| 124 | + animate={{ opacity: 1, y: 0 }} |
| 125 | + transition={{ delay: 0.5 }} |
| 126 | + className="mb-8" |
| 127 | + > |
| 128 | + <p className="text-muted-foreground mb-2">We sent a verification link to</p> |
| 129 | + <div className="inline-flex items-center gap-2 px-4 py-2 rounded-lg bg-primary/5 border border-primary/20"> |
| 130 | + <Mail className="w-4 h-4 text-primary" /> |
| 131 | + <span className="font-mono text-sm text-foreground">{email}</span> |
| 132 | + </div> |
| 133 | + </motion.div> |
| 134 | + |
| 135 | + {/* Instructions card */} |
| 136 | + <motion.div |
| 137 | + initial={{ opacity: 0, y: 10 }} |
| 138 | + animate={{ opacity: 1, y: 0 }} |
| 139 | + transition={{ delay: 0.6 }} |
| 140 | + className="bg-card/50 backdrop-blur-sm rounded-xl border border-border p-6 mb-6" |
| 141 | + > |
| 142 | + <div className="flex items-start gap-4 text-left"> |
| 143 | + <div className="w-8 h-8 rounded-lg bg-green-500/10 border border-green-500/20 flex items-center justify-center flex-shrink-0 mt-0.5"> |
| 144 | + <CheckCircle2 className="w-4 h-4 text-green-500" /> |
| 145 | + </div> |
| 146 | + <div> |
| 147 | + <p className="text-sm text-foreground font-medium mb-1"> |
| 148 | + Click the link in the email to verify your account |
| 149 | + </p> |
| 150 | + <p className="text-sm text-muted-foreground"> |
| 151 | + Didn't receive it? Check your spam folder or{' '} |
| 152 | + <button |
| 153 | + onClick={() => setEmailSent(false)} |
| 154 | + className="text-primary hover:underline font-medium" |
| 155 | + > |
| 156 | + try again |
| 157 | + </button> |
| 158 | + </p> |
| 159 | + </div> |
| 160 | + </div> |
| 161 | + </motion.div> |
| 162 | + |
| 163 | + {/* Back link */} |
| 164 | + <motion.div |
| 165 | + initial={{ opacity: 0 }} |
| 166 | + animate={{ opacity: 1 }} |
| 167 | + transition={{ delay: 0.7 }} |
| 168 | + > |
| 169 | + <Link |
| 170 | + to="/login" |
| 171 | + className="inline-flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground transition-colors" |
| 172 | + > |
| 173 | + <ArrowLeft className="w-4 h-4" /> |
| 174 | + Back to login |
| 175 | + </Link> |
| 176 | + </motion.div> |
| 177 | + </motion.div> |
111 | 178 | ) : ( |
112 | 179 | <> |
113 | 180 | <div className="text-center mb-8"> |
|
0 commit comments