-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from Design-System-Project/feature/tfr2-110-lo…
…gin-screen improve login screen
- Loading branch information
Showing
5 changed files
with
42 additions
and
26 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,8 +1,7 @@ | ||
'use client'; | ||
|
||
// eslint-disable-next-line import/named -- TODO: Review | ||
import { useFormState } from 'react-dom'; | ||
import { Input, Label, Text } from '@ds-project/components'; | ||
import { CardContent, CardFooter, Input, Label } from '@ds-project/components'; | ||
import { loginUser } from '../_actions'; | ||
import { Message } from './message'; | ||
import { SubmitButton } from './submit-button'; | ||
|
@@ -13,22 +12,21 @@ export const MagicLinkForm = () => { | |
}); | ||
|
||
return ( | ||
<form action={formAction} className="flex flex-col space-y-8"> | ||
<Label>Email</Label> | ||
<Input | ||
autoComplete="email" | ||
name="email" | ||
placeholder="[email protected]" | ||
required | ||
type="email" | ||
/> | ||
<p>Sign in instantly by getting a magic link sent to your email</p> | ||
|
||
<SubmitButton /> | ||
<Text> | ||
<p>{state.error}</p> | ||
</Text> | ||
<Message email={state.email} visible={state.ok} /> | ||
<form action={formAction} className="flex flex-col gap-4"> | ||
<CardContent className="grid gap-4"> | ||
<Label>Email</Label> | ||
<Input | ||
autoComplete="email" | ||
name="email" | ||
placeholder="[email protected]" | ||
required | ||
type="email" | ||
/> | ||
</CardContent> | ||
<CardFooter> | ||
<Message email={state.email} visible={state.ok} /> | ||
{!state.ok ? <SubmitButton /> : null} | ||
</CardFooter> | ||
</form> | ||
); | ||
}; |
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,11 +1,23 @@ | ||
import { Icons } from '@ds-project/components'; | ||
import { | ||
Card, | ||
CardDescription, | ||
CardHeader, | ||
CardTitle, | ||
} from '@ds-project/components'; | ||
import { MagicLinkForm } from './_components'; | ||
|
||
export default function Page() { | ||
return ( | ||
<section className="flex max-w-sm flex-col items-center gap-6"> | ||
<Icons.EnterIcon height={64} width={64} /> | ||
<Card className="w-full max-w-sm"> | ||
<CardHeader> | ||
<CardTitle className="text-2xl"> | ||
<h1>Login</h1> | ||
</CardTitle> | ||
<CardDescription> | ||
<p>Enter your email below to login to your account.</p> | ||
</CardDescription> | ||
</CardHeader> | ||
<MagicLinkForm /> | ||
</section> | ||
</Card> | ||
); | ||
} |
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