|
1 | 1 | <script lang="ts"> |
2 | 2 | import * as Form from '$components/ui/form' |
3 | 3 | import { Input } from '$components/ui/input' |
4 | | - import * as Card from '$components/ui/card' |
| 4 | + import { Checkbox } from '$components/ui/checkbox' |
5 | 5 | import { type SignupFormSchema, signupSchema } from './schema' |
6 | 6 | import { type Infer, type SuperValidated, superForm } from 'sveltekit-superforms' |
7 | 7 | import { zodClient } from 'sveltekit-superforms/adapters' |
|
26 | 26 | }) |
27 | 27 |
|
28 | 28 | const { form: formData, enhance } = form |
29 | | - $formData.email = 'test@test.com' |
30 | | - $formData.password = 'passwordAÖOGDÖADG' |
31 | | - $formData.confirmPassword = 'passwordAÖOGDÖADG' |
32 | 29 | </script> |
33 | 30 |
|
34 | | -<form method="POST" use:enhance> |
35 | | - <Card.Root class="m-auto w-[350px]"> |
36 | | - <Card.Header> |
37 | | - <Card.Title>Sign Up to tiny-tms</Card.Title> |
38 | | - <Card.Description>Register to tiny-tms and start doing you translations</Card.Description> |
39 | | - </Card.Header> |
40 | | - <Card.Content> |
| 31 | +<div class="flex items-center justify-center"> |
| 32 | + <div class="w-full max-w-2xl"> |
| 33 | + <div class="text-center"> |
| 34 | + <h2 class="mt-6 text-center text-3xl font-extrabold">Register</h2> |
| 35 | + <p class="mt-2 text-center text-sm"> |
| 36 | + Enter you information to create an user account for this Tiny-TMS instance |
| 37 | + </p> |
| 38 | + <p class="text-center text-sm"> |
| 39 | + or <a href="/login" class="font-medium underline">sign in to an existing account</a> |
| 40 | + </p> |
| 41 | + </div> |
| 42 | + <form method="POST" use:enhance> |
41 | 43 | <Form.Field {form} name="email"> |
42 | 44 | <Form.Control let:attrs> |
43 | | - <Form.Label>E-Mail</Form.Label> |
44 | | - <Input {...attrs} bind:value={$formData.email} /> |
| 45 | + <Form.Label>Email</Form.Label> |
| 46 | + <Input {...attrs} placeholder="m@example.com" bind:value={$formData.email} /> |
45 | 47 | </Form.Control> |
46 | | - <Form.Description>This is your e-mail.</Form.Description> |
47 | 48 | <Form.FieldErrors /> |
48 | 49 | </Form.Field> |
49 | 50 | <Form.Field {form} name="password"> |
50 | 51 | <Form.Control let:attrs> |
51 | 52 | <Form.Label>Password</Form.Label> |
52 | | - <Input {...attrs} type="password" bind:value={$formData.password} /> |
| 53 | + <Input |
| 54 | + {...attrs} |
| 55 | + placeholder="enter password" |
| 56 | + type="password" |
| 57 | + bind:value={$formData.password} |
| 58 | + /> |
53 | 59 | </Form.Control> |
54 | | - <Form.Description>This is your password</Form.Description> |
55 | 60 | <Form.FieldErrors /> |
56 | 61 | </Form.Field> |
57 | 62 | <Form.Field {form} name="confirmPassword"> |
58 | 63 | <Form.Control let:attrs> |
59 | 64 | <Form.Label>Confirm Password</Form.Label> |
60 | | - <Input {...attrs} type="password" bind:value={$formData.confirmPassword} /> |
| 65 | + <Input |
| 66 | + {...attrs} |
| 67 | + placeholder="enter password again" |
| 68 | + type="password" |
| 69 | + bind:value={$formData.confirmPassword} |
| 70 | + /> |
61 | 71 | </Form.Control> |
62 | | - <Form.Description>This is your password</Form.Description> |
63 | 72 | <Form.FieldErrors /> |
64 | 73 | </Form.Field> |
65 | | - </Card.Content> |
66 | | - <Card.Footer class="flex justify-end"> |
67 | | - <Form.Button>Sign Up</Form.Button> |
68 | | - </Card.Footer> |
69 | | - </Card.Root> |
70 | | -</form> |
| 74 | + |
| 75 | + <Form.Field {form} name="termsOfService"> |
| 76 | + <Form.Control let:attrs> |
| 77 | + <div class="mb-5 mt-7 flex items-center justify-between"> |
| 78 | + <div class="flex items-center"> |
| 79 | + <Checkbox {...attrs} bind:checked={$formData.termsOfService} /> |
| 80 | + <Form.Label class="ml-2 text-sm"> |
| 81 | + I agree with the <a href="/terms-of-service" class="font-medium underline"> |
| 82 | + Terms of Service |
| 83 | + </a> |
| 84 | + </Form.Label> |
| 85 | + <input name={attrs.name} value={$formData.termsOfService} hidden /> |
| 86 | + </div> |
| 87 | + </div> |
| 88 | + </Form.Control> |
| 89 | + </Form.Field> |
| 90 | + |
| 91 | + <Form.Button class="w-full">Sign Up</Form.Button> |
| 92 | + </form> |
| 93 | + </div> |
| 94 | +</div> |
0 commit comments