-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b4fe663
commit 81a0fec
Showing
5 changed files
with
134 additions
and
145 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,60 @@ | ||
import AcmeLogo from '@/app/ui/acme-logo'; | ||
import LoginForm from '@/app/ui/login-form'; | ||
"use client" | ||
|
||
import { Button } from '@/app/ui/button'; | ||
|
||
import { useFormState } from 'react-dom'; | ||
|
||
import { authenticate, authUser } from '../lib/actions'; | ||
|
||
|
||
export default function LoginPage() { | ||
|
||
const [errorMessage, dispatch] = useFormState(authenticate, undefined); | ||
|
||
|
||
return ( | ||
<main className="flex items-center justify-center md:h-screen"> | ||
<div className="relative mx-auto flex w-full max-w-[400px] flex-col space-y-2.5 p-4 md:-mt-32"> | ||
<div className="flex h-20 w-full items-end rounded-lg bg-blue-500 p-3 md:h-36"> | ||
<div className="w-32 text-white md:w-36"> | ||
<AcmeLogo /> | ||
<form action={dispatch} > | ||
<div className="w-full"> | ||
<div> | ||
<label | ||
className="mb-3 mt-5 block text-xs font-medium text-gray-900" | ||
htmlFor="email" | ||
> | ||
</label> | ||
<div className="relative"> | ||
<input | ||
className="peer block w-full rounded-md border border-gray-200 py-[9px] pl-10 text-sm outline-2 placeholder:text-gray-500" | ||
id="email" | ||
type="email" | ||
name="email" | ||
placeholder="Enter your email address" | ||
required | ||
/> | ||
</div> | ||
</div> | ||
<div className="mt-4"> | ||
<label | ||
className="mb-3 mt-5 block text-xs font-medium text-gray-900" | ||
htmlFor="password" | ||
> | ||
Password | ||
</label> | ||
<div className="relative"> | ||
<input | ||
className="peer block w-full rounded-md border border-gray-200 py-[9px] pl-10 text-sm outline-2 placeholder:text-gray-500" | ||
id="password" | ||
type="password" | ||
name="password" | ||
placeholder="Enter password" | ||
required | ||
/> | ||
</div> | ||
</div> | ||
</div> | ||
<LoginForm /> | ||
</div> | ||
<Button type = "submit">Log in</Button> | ||
</form> | ||
</main> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters