Skip to content

Commit bcaba31

Browse files
committed
More layout fixes n stuff
1 parent 6540586 commit bcaba31

2 files changed

Lines changed: 35 additions & 36 deletions

File tree

src/routes/(anonymous)/login/+page.svelte

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
</script>
5555

5656
<Container class="items-center">
57-
<form class="flex flex-col gap-4" onsubmit={handleSubmission}>
57+
<form class="flex flex-col gap-2" onsubmit={handleSubmission}>
5858
<div class="text-3xl font-semibold">Login</div>
5959

6060
<TextInput
@@ -64,6 +64,7 @@
6464
bind:value={usernameOrEmail}
6565
validationResult={usernameError}
6666
/>
67+
6768
<PasswordInput
6869
label="Password"
6970
placeholder="Password"

src/routes/(anonymous)/signup/+page.svelte

Lines changed: 33 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import { Button } from '$lib/components/ui/button';
1010
import * as Card from '$lib/components/ui/card';
1111
import * as Dialog from '$lib/components/ui/dialog';
12+
import { handleApiError } from '$lib/errorhandling/apiErrorHandling';
1213
import { validatePasswordMatch } from '$lib/inputvalidation/passwordValidator';
1314
import { toast } from 'svelte-sonner';
1415
@@ -56,6 +57,7 @@
5657
turnstileResponse,
5758
})
5859
.then(() => (accountCreated = true))
60+
.catch(handleApiError)
5961
.finally(() => {
6062
turnstileResponse = null;
6163
});
@@ -75,39 +77,35 @@
7577
</Dialog.Content>
7678
</Dialog.Root>
7779

78-
<Container>
79-
<Card.Header>
80-
<Card.Title class="text-3xl text-nowrap">Sign Up</Card.Title>
81-
</Card.Header>
82-
<Card.Content>
83-
<form class="flex flex-col space-y-2" onsubmit={handleSubmission}>
84-
<UsernameInput
85-
label="Username"
86-
placeholder="Username"
87-
bind:value={username}
88-
bind:valid={usernameValid}
89-
/>
90-
<EmailInput label="Email" placeholder="Email" bind:value={email} bind:valid={emailValid} />
91-
<PasswordInput
92-
label="Password"
93-
placeholder="Password"
94-
autocomplete="new-password"
95-
bind:value={password}
96-
bind:valid={passwordValid}
97-
validate={true}
98-
showStrengthMeter={true}
99-
/>
100-
<PasswordInput
101-
label="Confirm Password"
102-
placeholder="Confirm Password"
103-
autocomplete="new-password"
104-
bind:value={passwordConfirm}
105-
validate={validatePasswordMatch(passwordConfirm, password)}
106-
/>
107-
108-
<Turnstile action="signup" bind:response={turnstileResponse} />
109-
110-
<Button type="submit" disabled={!canSubmit}>Sign Up</Button>
111-
</form>
112-
</Card.Content>
80+
<Container class="items-center">
81+
<form class="flex flex-col gap-2" onsubmit={handleSubmission}>
82+
<div class="text-3xl font-semibold text-nowrap">Sign Up</div>
83+
<UsernameInput
84+
label="Username"
85+
placeholder="Username"
86+
bind:value={username}
87+
bind:valid={usernameValid}
88+
/>
89+
<EmailInput label="Email" placeholder="Email" bind:value={email} bind:valid={emailValid} />
90+
<PasswordInput
91+
label="Password"
92+
placeholder="Password"
93+
autocomplete="new-password"
94+
bind:value={password}
95+
bind:valid={passwordValid}
96+
validate={true}
97+
showStrengthMeter={true}
98+
/>
99+
<PasswordInput
100+
label="Confirm Password"
101+
placeholder="Confirm Password"
102+
autocomplete="new-password"
103+
bind:value={passwordConfirm}
104+
validate={validatePasswordMatch(passwordConfirm, password)}
105+
/>
106+
107+
<Turnstile action="signup" bind:response={turnstileResponse} />
108+
109+
<Button type="submit" disabled={!canSubmit}>Sign Up</Button>
110+
</form>
113111
</Container>

0 commit comments

Comments
 (0)