Match password recovery styling to shared academy login layout
This commit is contained in:
parent
9d5099284a
commit
b08ab8fc4d
49
src/components/auth/AcademyAuthLayout.tsx
Normal file
49
src/components/auth/AcademyAuthLayout.tsx
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
import type { ReactNode } from "react";
|
||||
import { BrandLogo } from "../brand/BrandLogo";
|
||||
|
||||
export function AcademyAuthLayout({ children }: { children: ReactNode }) {
|
||||
return (
|
||||
<main className="academy-login">
|
||||
<section className="academy-login-art" aria-label="Rezina makeup academy">
|
||||
<svg className="academy-login-waves" viewBox="0 0 800 1000" preserveAspectRatio="none" aria-hidden="true">
|
||||
<defs>
|
||||
<linearGradient id="login-fold" x1="0" y1="0" x2="1" y2="1">
|
||||
<stop stopColor="#565961" /><stop offset="0.5" stopColor="#24262c" /><stop offset="1" stopColor="#090a0d" />
|
||||
</linearGradient>
|
||||
<linearGradient id="login-shadow" x1="0" y1="0" x2="1" y2="0">
|
||||
<stop stopColor="#111216" /><stop offset="0.65" stopColor="#35373f" /><stop offset="1" stopColor="#191a20" />
|
||||
</linearGradient>
|
||||
<filter id="login-depth" x="-50%" y="-30%" width="200%" height="160%">
|
||||
<feDropShadow dx="18" dy="12" stdDeviation="18" floodOpacity="0.4" />
|
||||
</filter>
|
||||
</defs>
|
||||
<path fill="#0c0d10" d="M0 0H800V1000H0Z" />
|
||||
<g filter="url(#login-depth)">
|
||||
<path fill="url(#login-fold)" d="M0 0H780C720 120 422 36 466 208C493 319 723 329 661 490C603 643 387 585 431 747C470 890 763 801 733 1000H0Z" />
|
||||
<path fill="url(#login-shadow)" d="M0 0H601C635 144 320 130 367 305C400 429 600 442 506 582C420 712 277 670 324 818C350 908 563 906 554 1000H0Z" />
|
||||
<path fill="url(#login-fold)" d="M0 0H443C460 156 202 153 222 341C234 448 433 477 361 629C295 770 144 735 197 890C215 943 306 954 296 1000H0Z" />
|
||||
<path fill="#a8aaaf" d="M0 0H288C283 171 55 154 69 340C81 500 275 532 218 684C175 798 52 816 80 1000H0Z" />
|
||||
</g>
|
||||
</svg>
|
||||
<p className="academy-login-welcome">Welcome<br />back.</p>
|
||||
<div className="academy-login-brand">
|
||||
<BrandLogo variant="light" className="h-20 max-w-full sm:h-24" />
|
||||
<div className="mt-7 h-px w-12 bg-white/45" />
|
||||
<p className="mt-6 text-xs font-medium uppercase tracking-[0.3em] text-white/65">The beauty academy</p>
|
||||
<h2 className="mt-3 text-4xl font-medium leading-tight text-white sm:text-5xl">Artistry starts here.</h2>
|
||||
</div>
|
||||
<p className="academy-login-art-footer">MAKEUP SCHOOL & STUDIO <span>EST. FOR CREATIVITY</span></p>
|
||||
</section>
|
||||
|
||||
<section className="academy-login-panel">
|
||||
<div className="academy-login-form-wrap">
|
||||
<div className="mb-10 lg:hidden"><BrandLogo variant="light" className="h-14" /></div>
|
||||
{children}
|
||||
<footer className="mt-14 flex flex-wrap items-center justify-between gap-3 border-t border-white/10 pt-5 text-[10px] text-white/35">
|
||||
<span>© {new Date().getFullYear()} Sirkul Makeup School Studio</span><span>v{__BUILD_HASH__}</span>
|
||||
</footer>
|
||||
</div>
|
||||
</section>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
|
|
@ -1,10 +1,9 @@
|
|||
import { useState } from "react"
|
||||
import { Link } from "react-router-dom"
|
||||
import { ArrowLeft } from "lucide-react"
|
||||
import { ArrowLeft, ArrowRight, Check, LockKeyhole } from "lucide-react"
|
||||
import { toast } from "sonner"
|
||||
import successSrc from "../../assets/success.svg"
|
||||
import { sendTeamPasswordReset } from "../../api/team.api"
|
||||
import { BrandLogo } from "../../components/brand/BrandLogo"
|
||||
import { AcademyAuthLayout } from "../../components/auth/AcademyAuthLayout"
|
||||
import { Button } from "../../components/ui/button"
|
||||
import { Input } from "../../components/ui/input"
|
||||
import { SpinnerIcon } from "../../components/ui/spinner-icon"
|
||||
|
|
@ -41,128 +40,43 @@ export function ForgotPasswordPage() {
|
|||
}
|
||||
|
||||
return (
|
||||
<div className="relative flex h-dvh overflow-y-auto">
|
||||
<div className="relative hidden items-center justify-center bg-gradient-to-br from-brand-600 via-brand-500 to-brand-400 lg:flex lg:w-1/2 xl:w-[55%]">
|
||||
<div className="absolute inset-0 overflow-hidden">
|
||||
<div className="absolute -left-20 -top-20 h-96 w-96 rounded-full bg-white/5" />
|
||||
<div className="absolute -bottom-32 -right-16 h-[500px] w-[500px] rounded-full bg-white/5" />
|
||||
<div className="absolute left-1/3 top-1/4 h-64 w-64 rounded-full bg-white/5" />
|
||||
<div className="absolute bottom-1/4 left-1/4 h-48 w-48 rotate-45 rounded-3xl bg-white/[0.03]" />
|
||||
<AcademyAuthLayout>
|
||||
<Link to="/login" className="mb-10 inline-flex items-center gap-2 text-xs text-white/60 transition hover:text-white">
|
||||
<ArrowLeft size={15} aria-hidden="true" /> Back to sign in
|
||||
</Link>
|
||||
{submitted ? (
|
||||
<div role="status" aria-live="polite">
|
||||
<div className="mb-7 flex h-12 w-12 items-center justify-center rounded-md border border-white/20 bg-white/5"><Check size={23} aria-hidden="true" /></div>
|
||||
<p className="mb-4 text-[10px] font-medium uppercase tracking-[0.25em] text-white/50">Account recovery</p>
|
||||
<h1 className="text-4xl font-medium tracking-tight text-white sm:text-5xl">Check your email</h1>
|
||||
<p className="mt-4 text-sm leading-6 text-white/60">We've sent a password reset link to <span className="break-all font-medium text-white">{email.trim()}</span>. The link expires in 5 minutes. Open it promptly to set a new password.</p>
|
||||
<Button type="button" className="academy-login-submit mt-8 h-12 w-full justify-between rounded-md px-5 text-sm font-semibold" onClick={() => {setSubmitted(false);setError(null)}}>
|
||||
Try a different email <ArrowRight size={17} aria-hidden="true" />
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
<div className="relative z-10 max-w-md px-12 text-center">
|
||||
<BrandLogo variant="light" className="mx-auto mb-8 h-16" />
|
||||
<p className="text-base leading-relaxed text-white/70">
|
||||
Manage your academy, track student progress, and streamline
|
||||
operations — all from one powerful dashboard.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="flex w-full flex-col items-center justify-center bg-white px-6 py-12 lg:w-1/2 xl:w-[45%]">
|
||||
<div className="w-full max-w-[420px]">
|
||||
<div className="mb-10 flex justify-center lg:hidden">
|
||||
<BrandLogo />
|
||||
) : (
|
||||
<>
|
||||
<div className="mb-10">
|
||||
<p className="mb-4 flex items-center gap-2 text-[10px] font-medium uppercase tracking-[0.25em] text-white/50"><LockKeyhole size={13} aria-hidden="true" /> Account recovery</p>
|
||||
<h1 className="text-4xl font-medium tracking-tight text-white sm:text-5xl">Forgot password?</h1>
|
||||
<p className="mt-4 text-sm leading-6 text-white/60">Enter your academy team email and we'll send you a link to reset your password.</p>
|
||||
</div>
|
||||
|
||||
<Link
|
||||
to="/login"
|
||||
className="mb-8 inline-flex items-center gap-1.5 text-sm font-medium text-grayScale-400 transition-colors hover:text-grayScale-600"
|
||||
>
|
||||
<ArrowLeft size={16} />
|
||||
Back to sign in
|
||||
</Link>
|
||||
|
||||
{submitted ? (
|
||||
<div className="text-center">
|
||||
<img src={successSrc} alt="" className="mx-auto mb-6 h-20 w-20" />
|
||||
<h1 className="mb-2 text-2xl font-bold tracking-tight text-grayScale-600">
|
||||
Check your email
|
||||
</h1>
|
||||
<p className="mb-8 text-sm leading-relaxed text-grayScale-400">
|
||||
We've sent a password reset link to{" "}
|
||||
<span className="font-medium text-grayScale-600">{email.trim()}</span>.
|
||||
The link expires in 5 minutes — open it promptly to set a new password.
|
||||
</p>
|
||||
<Button
|
||||
type="button"
|
||||
variant="outline"
|
||||
className="h-11 rounded-[6px] px-6 text-sm font-semibold"
|
||||
onClick={() => {
|
||||
setSubmitted(false)
|
||||
setError(null)
|
||||
}}
|
||||
>
|
||||
Try a different email
|
||||
</Button>
|
||||
<form onSubmit={handleSubmit} className="space-y-6" aria-busy={submitting}>
|
||||
<div>
|
||||
<label htmlFor="email" className="mb-2.5 block text-xs font-medium text-white/85">Email address</label>
|
||||
<Input id="email" name="email" type="email" placeholder="Enter your email" value={email}
|
||||
onChange={(e) => {setEmail(e.target.value);if (error) setError(null)}} required autoComplete="email" disabled={submitting}
|
||||
className="academy-login-input" aria-describedby={error ? "reset-error" : undefined} />
|
||||
</div>
|
||||
) : (
|
||||
<>
|
||||
<div className="mb-10">
|
||||
<p className="mb-1.5 text-sm font-medium uppercase tracking-widest text-brand-400">
|
||||
Account Recovery
|
||||
</p>
|
||||
<h1 className="mb-2 text-3xl font-bold tracking-tight text-grayScale-600">
|
||||
Forgot password?
|
||||
</h1>
|
||||
<p className="text-sm leading-relaxed text-grayScale-400">
|
||||
Enter your team email and we'll send you a reset link.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<form onSubmit={handleSubmit} className="space-y-5">
|
||||
<div>
|
||||
<label
|
||||
htmlFor="email"
|
||||
className="mb-1.5 block text-sm font-medium text-grayScale-600"
|
||||
>
|
||||
Email address
|
||||
</label>
|
||||
<Input
|
||||
id="email"
|
||||
type="email"
|
||||
placeholder="you@example.com"
|
||||
value={email}
|
||||
onChange={(e) => {
|
||||
setEmail(e.target.value)
|
||||
if (error) setError(null)
|
||||
}}
|
||||
required
|
||||
autoComplete="email"
|
||||
disabled={submitting}
|
||||
className="h-11 rounded-xl"
|
||||
/>
|
||||
</div>
|
||||
|
||||
{error ? (
|
||||
<p className="rounded-lg border border-red-200 bg-red-50 px-3 py-2 text-sm text-red-700">
|
||||
{error}
|
||||
</p>
|
||||
) : null}
|
||||
|
||||
<Button
|
||||
type="submit"
|
||||
disabled={submitting}
|
||||
className="mt-2 h-11 w-full rounded-[6px] text-sm font-semibold tracking-wide"
|
||||
>
|
||||
{submitting ? (
|
||||
<span className="inline-flex items-center gap-2">
|
||||
<SpinnerIcon className="h-4 w-4" />
|
||||
Sending…
|
||||
</span>
|
||||
) : (
|
||||
"Send reset link"
|
||||
)}
|
||||
</Button>
|
||||
</form>
|
||||
</>
|
||||
)}
|
||||
|
||||
<p className="mt-10 text-center text-xs text-grayScale-400">
|
||||
© {new Date().getFullYear()} Rezina Academy · All rights reserved
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{error && <p id="reset-error" role="alert" className="rounded-md border border-red-300/30 bg-red-400/10 px-4 py-3 text-sm text-red-200">{error}</p>}
|
||||
<Button type="submit" disabled={submitting} className="academy-login-submit h-12 w-full justify-between rounded-md px-5 text-sm font-semibold">
|
||||
{submitting ? <span className="inline-flex items-center gap-2"><SpinnerIcon className="h-4 w-4" /> Sending...</span> : "Send reset link"}
|
||||
<ArrowRight size={17} aria-hidden="true" />
|
||||
</Button>
|
||||
</form>
|
||||
<p className="mt-7 text-xs leading-5 text-white/40">Need help accessing your academy account?<br />Contact your administrator.</p>
|
||||
</>
|
||||
)}
|
||||
</AcademyAuthLayout>
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import { useCallback, useEffect, useState } from "react";
|
|||
import { Link, Navigate, useNavigate, useSearchParams } from "react-router-dom";
|
||||
import { getApiErrorMessage } from "../../lib/apiErrors";
|
||||
|
||||
import { BrandLogo } from "../../components/brand/BrandLogo";
|
||||
import { AcademyAuthLayout } from "../../components/auth/AcademyAuthLayout";
|
||||
import { Button } from "../../components/ui/button";
|
||||
import { Input } from "../../components/ui/input";
|
||||
import { Label } from "../../components/ui/label";
|
||||
|
|
@ -99,41 +99,7 @@ export function LoginPage() {
|
|||
};
|
||||
|
||||
return (
|
||||
<main className="academy-login">
|
||||
<section className="academy-login-art" aria-label="Rezina makeup academy">
|
||||
<svg className="academy-login-waves" viewBox="0 0 800 1000" preserveAspectRatio="none" aria-hidden="true">
|
||||
<defs>
|
||||
<linearGradient id="login-fold" x1="0" y1="0" x2="1" y2="1">
|
||||
<stop stopColor="#565961" /><stop offset="0.5" stopColor="#24262c" /><stop offset="1" stopColor="#090a0d" />
|
||||
</linearGradient>
|
||||
<linearGradient id="login-shadow" x1="0" y1="0" x2="1" y2="0">
|
||||
<stop stopColor="#111216" /><stop offset="0.65" stopColor="#35373f" /><stop offset="1" stopColor="#191a20" />
|
||||
</linearGradient>
|
||||
<filter id="login-depth" x="-50%" y="-30%" width="200%" height="160%">
|
||||
<feDropShadow dx="18" dy="12" stdDeviation="18" floodOpacity="0.4" />
|
||||
</filter>
|
||||
</defs>
|
||||
<path fill="#0c0d10" d="M0 0H800V1000H0Z" />
|
||||
<g filter="url(#login-depth)">
|
||||
<path fill="url(#login-fold)" d="M0 0H780C720 120 422 36 466 208C493 319 723 329 661 490C603 643 387 585 431 747C470 890 763 801 733 1000H0Z" />
|
||||
<path fill="url(#login-shadow)" d="M0 0H601C635 144 320 130 367 305C400 429 600 442 506 582C420 712 277 670 324 818C350 908 563 906 554 1000H0Z" />
|
||||
<path fill="url(#login-fold)" d="M0 0H443C460 156 202 153 222 341C234 448 433 477 361 629C295 770 144 735 197 890C215 943 306 954 296 1000H0Z" />
|
||||
<path fill="#a8aaaf" d="M0 0H288C283 171 55 154 69 340C81 500 275 532 218 684C175 798 52 816 80 1000H0Z" />
|
||||
</g>
|
||||
</svg>
|
||||
<p className="academy-login-welcome">Welcome<br />back.</p>
|
||||
<div className="academy-login-brand">
|
||||
<BrandLogo variant="light" className="h-20 max-w-full sm:h-24" />
|
||||
<div className="mt-7 h-px w-12 bg-white/45" />
|
||||
<p className="mt-6 text-xs font-medium uppercase tracking-[0.3em] text-white/65">The beauty academy</p>
|
||||
<h2 className="mt-3 text-4xl font-medium leading-tight text-white sm:text-5xl">Artistry starts here.</h2>
|
||||
</div>
|
||||
<p className="academy-login-art-footer">MAKEUP SCHOOL & STUDIO <span>EST. FOR CREATIVITY</span></p>
|
||||
</section>
|
||||
|
||||
<section className="academy-login-panel">
|
||||
<div className="academy-login-form-wrap">
|
||||
<div className="mb-10 lg:hidden"><BrandLogo variant="light" className="h-14" /></div>
|
||||
<AcademyAuthLayout>
|
||||
<div className="mb-10">
|
||||
<p className="mb-4 flex items-center gap-2 text-[10px] font-medium uppercase tracking-[0.25em] text-white/50"><LockKeyhole size={13} aria-hidden="true" /> Academy workspace</p>
|
||||
<h1 className="text-4xl font-medium tracking-tight text-white sm:text-5xl">Admin login</h1>
|
||||
|
|
@ -170,11 +136,6 @@ export function LoginPage() {
|
|||
</Button>
|
||||
</form>
|
||||
<p className="mt-7 text-xs leading-5 text-white/40">Access is reserved for academy team members.<br />Contact your administrator if you need an account.</p>
|
||||
<footer className="mt-14 flex flex-wrap items-center justify-between gap-3 border-t border-white/10 pt-5 text-[10px] text-white/35">
|
||||
<span>© {new Date().getFullYear()} Rezina Academy</span><span>v{__BUILD_HASH__}</span>
|
||||
</footer>
|
||||
</div>
|
||||
</section>
|
||||
</main>
|
||||
</AcademyAuthLayout>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user