feat(auth): add registration message for successful registration

This commit is contained in:
shafin-r
2026-03-12 13:51:20 +06:00
parent 8d86da05b5
commit 4c83fcf7b4
2 changed files with 22 additions and 3 deletions

View File

@ -313,6 +313,13 @@ const STYLES = `
display:flex;align-items:center;gap:0.5rem;
}
.lg-success {
background:#f0fdf4;border:2px solid #bbf7d0;border-radius:14px;padding:0.8rem 1rem;
font-family:'Nunito Sans',sans-serif;font-size:0.82rem;font-weight:700;color:#15803d;
display:flex;align-items:center;gap:0.5rem;
animation: formPop 0.4s cubic-bezier(0.34,1.56,0.64,1) both;
}
.lg-btn {
width:100%;padding:1rem;background:#f97316;color:white;border:none;border-radius:100px;cursor:pointer;
font-family:'Nunito',sans-serif;font-size:1rem;font-weight:900;
@ -365,8 +372,14 @@ export const Login = () => {
const navigate = useNavigate();
const location = useLocation();
const { login, isAuthenticated, isLoading, error, clearError } =
useAuthStore();
const {
login,
isAuthenticated,
isLoading,
error,
clearError,
registrationMessage,
} = useAuthStore();
const from =
(location.state as LocationState)?.from?.pathname || "/student/home";
@ -673,6 +686,12 @@ export const Login = () => {
</label>
</div>
{registrationMessage && (
<div className="lg-success">
<span></span> {registrationMessage}
</div>
)}
{error && (
<div className="lg-error">
<span></span> {error}