This commit is contained in:
User
2024-12-27 20:43:18 -05:00
parent 89d0394de9
commit da918835c2
84 changed files with 6160 additions and 1068 deletions

View File

@@ -2,7 +2,10 @@ import InputError from '@/Components/InputError';
import PrimaryButton from '@/Components/PrimaryButton';
import TextInput from '@/Components/TextInput';
import GuestLayout from '@/Layouts/GuestLayout';
import { Head, useForm } from '@inertiajs/react';
import { Head, Link, useForm } from '@inertiajs/react';
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/Components/ui/card.jsx";
import { Label } from "@/Components/ui/label.jsx";
import { Alert, AlertDescription } from "@/components/ui/alert";
export default function ForgotPassword({ status }) {
const { data, setData, post, processing, errors } = useForm({
@@ -18,38 +21,47 @@ export default function ForgotPassword({ status }) {
return (
<GuestLayout>
<Head title="Forgot Password" />
<div className="mb-4 text-sm text-gray-600 dark:text-gray-400">
Forgot your password? No problem. Just let us know your email
address and we will email you a password reset link that will
allow you to choose a new one.
<div className="flex flex-col gap-6">
{ status && (<Alert>
<AlertDescription>
{ status }
</AlertDescription>
</Alert> ) }
<Card>
<CardHeader>
<CardTitle className="text-2xl">Forgot Password</CardTitle>
<CardDescription>
Forgot your password? No problem. Just let us know your email
address and we will email you a password reset link that will
allow you to choose a new one.
</CardDescription>
</CardHeader>
<CardContent>
<form onSubmit={ submit }>
<div className="flex flex-col gap-6">
<div className="grid gap-2">
<Label htmlFor="email">E-mail Address</Label>
<TextInput type="email" id="email" placeholder="me@yumj.in" value={ data.email }
onChange={ (e) => setData('email', e.target.value) } required />
<InputError message={ errors.email } className="mt-2" />
</div>
<PrimaryButton type="submit" disabled={ processing }
className="w-full">Email Password Reset Link</PrimaryButton>
</div>
<div className="mt-4 text-center text-sm">
Return to &nbsp;
<Link href={ route('login') } className="underline underline-offset-4">
Login
</Link>
&nbsp; | &nbsp;
<Link href={ route('register') } className="underline underline-offset-4">
Sign up
</Link>
</div>
</form>
</CardContent>
</Card>
</div>
{status && (
<div className="mb-4 text-sm font-medium text-green-600 dark:text-green-400">
{status}
</div>
)}
<form onSubmit={submit}>
<TextInput
id="email"
type="email"
name="email"
value={data.email}
className="mt-1 block w-full"
isFocused={true}
onChange={(e) => setData('email', e.target.value)}
/>
<InputError message={errors.email} className="mt-2" />
<div className="mt-4 flex items-center justify-end">
<PrimaryButton className="ms-4" disabled={processing}>
Email Password Reset Link
</PrimaryButton>
</div>
</form>
</GuestLayout>
);
}