|
3 | 3 | import { page } from '$app/stores';
|
4 | 4 | import ErrorMessage from '$comp/ErrorMessage.svelte';
|
5 | 5 | import Loading from '$comp/Loading.svelte';
|
6 |
| - import { A, H2, Muted, P } from '$comp/typography'; |
| 6 | + import Logo from '$comp/Logo.svelte'; |
| 7 | + import { A, Muted, P } from '$comp/typography'; |
7 | 8 | import { Button } from '$comp/ui/button';
|
| 9 | + import * as Card from '$comp/ui/card'; |
8 | 10 | import * as Form from '$comp/ui/form';
|
9 | 11 | import { Input } from '$comp/ui/input';
|
10 | 12 | import {
|
|
55 | 57 | const { enhance, form: formData, message, submitting } = form;
|
56 | 58 | </script>
|
57 | 59 |
|
58 |
| -<H2 class="mb-2 mt-4 text-center leading-9">Log in to your account</H2> |
| 60 | +<Card.Root class="mx-auto max-w-sm"> |
| 61 | + <Card.Header> |
| 62 | + <Logo /> |
| 63 | + <Card.Title class="text-center text-2xl">Log in to your account</Card.Title> |
| 64 | + </Card.Header> |
| 65 | + <Card.Content> |
| 66 | + <form method="POST" use:enhance> |
| 67 | + <ErrorMessage message={$message}></ErrorMessage> |
| 68 | + <Form.Field {form} name="email"> |
| 69 | + <Form.Control> |
| 70 | + {#snippet children({ props })} |
| 71 | + <Form.Label>Email</Form.Label> |
| 72 | + <Input {...props} bind:value={$formData.email} type="email" placeholder="Enter email address" autocomplete="email" required /> |
| 73 | + {/snippet} |
| 74 | + </Form.Control> |
| 75 | + <Form.Description /> |
| 76 | + <Form.FieldErrors /> |
| 77 | + </Form.Field> |
| 78 | + <Form.Field {form} name="password"> |
| 79 | + <Form.Control> |
| 80 | + {#snippet children({ props })} |
| 81 | + <Form.Label |
| 82 | + >Password |
| 83 | + <Muted class="float-right"> |
| 84 | + <A href="/forgot-password">Forgot password?</A> |
| 85 | + </Muted></Form.Label |
| 86 | + > |
| 87 | + <Input |
| 88 | + {...props} |
| 89 | + bind:value={$formData.password} |
| 90 | + type="password" |
| 91 | + placeholder="Enter password" |
| 92 | + autocomplete="current-password" |
| 93 | + maxlength={100} |
| 94 | + minlength={6} |
| 95 | + required |
| 96 | + /> |
| 97 | + {/snippet} |
| 98 | + </Form.Control> |
| 99 | + <Form.Description /> |
| 100 | + <Form.FieldErrors /> |
| 101 | + </Form.Field> |
| 102 | + <Form.Button> |
| 103 | + {#if $submitting} |
| 104 | + <Loading class="mr-2" variant="secondary"></Loading> Logging in... |
| 105 | + {:else} |
| 106 | + Login |
| 107 | + {/if}</Form.Button |
| 108 | + > |
| 109 | + </form> |
59 | 110 |
|
60 |
| -<form method="POST" use:enhance> |
61 |
| - <ErrorMessage message={$message}></ErrorMessage> |
62 |
| - <Form.Field {form} name="email"> |
63 |
| - <Form.Control> |
64 |
| - {#snippet children({ props })} |
65 |
| - <Form.Label>Email</Form.Label> |
66 |
| - <Input {...props} bind:value={$formData.email} type="email" placeholder="Enter email address" autocomplete="email" required /> |
67 |
| - {/snippet} |
68 |
| - </Form.Control> |
69 |
| - <Form.Description /> |
70 |
| - <Form.FieldErrors /> |
71 |
| - </Form.Field> |
72 |
| - <Form.Field {form} name="password"> |
73 |
| - <Form.Control> |
74 |
| - {#snippet children({ props })} |
75 |
| - <Form.Label |
76 |
| - >Password |
77 |
| - <Muted class="float-right"> |
78 |
| - <A href="/forgot-password">Forgot password?</A> |
79 |
| - </Muted></Form.Label |
80 |
| - > |
81 |
| - <Input |
82 |
| - {...props} |
83 |
| - bind:value={$formData.password} |
84 |
| - type="password" |
85 |
| - placeholder="Enter password" |
86 |
| - autocomplete="current-password" |
87 |
| - maxlength={100} |
88 |
| - minlength={6} |
89 |
| - required |
90 |
| - /> |
91 |
| - {/snippet} |
92 |
| - </Form.Control> |
93 |
| - <Form.Description /> |
94 |
| - <Form.FieldErrors /> |
95 |
| - </Form.Field> |
96 |
| - <Form.Button> |
97 |
| - {#if $submitting} |
98 |
| - <Loading class="mr-2" variant="secondary"></Loading> Logging in... |
99 |
| - {:else} |
100 |
| - Login |
101 |
| - {/if}</Form.Button |
102 |
| - > |
103 |
| -</form> |
104 |
| - |
105 |
| -{#if enableOAuthLogin} |
106 |
| - <div class="my-4 flex w-full items-center"> |
107 |
| - <hr class="w-full" /> |
108 |
| - <P class="px-3">OR</P> |
109 |
| - <hr class="w-full" /> |
110 |
| - </div> |
111 |
| - <div class="auto-cols-2 grid grid-flow-col grid-rows-2 gap-4"> |
112 |
| - {#if microsoftClientId} |
113 |
| - <Button aria-label="Login with Microsoft" onclick={() => liveLogin(redirectUrl)}> |
114 |
| - <IconMicrosoft /> Microsoft |
115 |
| - </Button> |
116 |
| - {/if} |
117 |
| - {#if googleClientId} |
118 |
| - <Button aria-label="Login with Google" onclick={() => googleLogin(redirectUrl)}> |
119 |
| - <IconGoogle /> Google |
120 |
| - </Button> |
121 |
| - {/if} |
122 |
| - {#if facebookClientId} |
123 |
| - <Button aria-label="Login with Facebook" onclick={() => facebookLogin(redirectUrl)}> |
124 |
| - <IconFacebook /> Facebook |
125 |
| - </Button> |
| 111 | + {#if enableOAuthLogin} |
| 112 | + <div class="my-4 flex w-full items-center"> |
| 113 | + <hr class="w-full" /> |
| 114 | + <P class="px-3">OR</P> |
| 115 | + <hr class="w-full" /> |
| 116 | + </div> |
| 117 | + <div class="auto-cols-2 grid grid-flow-col grid-rows-2 gap-4"> |
| 118 | + {#if microsoftClientId} |
| 119 | + <Button aria-label="Login with Microsoft" onclick={() => liveLogin(redirectUrl)}> |
| 120 | + <IconMicrosoft /> Microsoft |
| 121 | + </Button> |
| 122 | + {/if} |
| 123 | + {#if googleClientId} |
| 124 | + <Button aria-label="Login with Google" onclick={() => googleLogin(redirectUrl)}> |
| 125 | + <IconGoogle /> Google |
| 126 | + </Button> |
| 127 | + {/if} |
| 128 | + {#if facebookClientId} |
| 129 | + <Button aria-label="Login with Facebook" onclick={() => facebookLogin(redirectUrl)}> |
| 130 | + <IconFacebook /> Facebook |
| 131 | + </Button> |
| 132 | + {/if} |
| 133 | + {#if gitHubClientId} |
| 134 | + <Button aria-label="Login with GitHub" onclick={() => githubLogin(redirectUrl)}> |
| 135 | + <IconGitHub /> GitHub |
| 136 | + </Button> |
| 137 | + {/if} |
| 138 | + </div> |
126 | 139 | {/if}
|
127 |
| - {#if gitHubClientId} |
128 |
| - <Button aria-label="Login with GitHub" onclick={() => githubLogin(redirectUrl)}> |
129 |
| - <IconGitHub /> GitHub |
130 |
| - </Button> |
131 |
| - {/if} |
132 |
| - </div> |
133 |
| -{/if} |
134 | 140 |
|
135 |
| -{#if enableAccountCreation} |
136 |
| - <P class="text-center text-sm"> |
137 |
| - Not a member? |
138 |
| - <A href="/signup">Start a free trial</A> |
139 |
| - </P> |
| 141 | + {#if enableAccountCreation} |
| 142 | + <P class="text-center text-sm"> |
| 143 | + Not a member? |
| 144 | + <A href="/signup">Start a free trial</A> |
| 145 | + </P> |
140 | 146 |
|
141 |
| - <P class="text-center text-sm"> |
142 |
| - By signing up, you agree to our <A href="https://exceptionless.com/privacy" target="_blank">Privacy Policy</A> |
143 |
| - and |
144 |
| - <A href="https://exceptionless.com/terms" target="_blank">Terms of Service</A>. |
145 |
| - </P> |
146 |
| -{/if} |
| 147 | + <P class="text-center text-sm"> |
| 148 | + By signing up, you agree to our <A href="https://exceptionless.com/privacy" target="_blank">Privacy Policy</A> |
| 149 | + and |
| 150 | + <A href="https://exceptionless.com/terms" target="_blank">Terms of Service</A>. |
| 151 | + </P> |
| 152 | + {/if} |
| 153 | + </Card.Content> |
| 154 | +</Card.Root> |
0 commit comments