Skip to content

Commit 245c299

Browse files
Merge pull request #50 from aleksasiriski/mk/fix/card-pos
fix: card positioning
2 parents b32acbc + 5ebf427 commit 245c299

File tree

5 files changed

+98
-104
lines changed

5 files changed

+98
-104
lines changed

src/routes/(dashboard)/create/employee/+page.svelte

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
const { form: formData, enhance } = form;
2525
</script>
2626

27-
<form method="POST" class="flex w-full items-center justify-center px-4 pt-4" use:enhance>
27+
<form method="POST" class="flex h-[90dvh] w-full items-center justify-center px-4" use:enhance>
2828
<Card.Root class="mx-auto w-full max-w-sm">
2929
<Card.Header>
3030
<Card.Title class="text-2xl">Create employee</Card.Title>

src/routes/(dashboard)/create/student/+page.svelte

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
const { form: formData, enhance } = form;
2525
</script>
2626

27-
<form method="POST" class="flex w-full items-center justify-center px-4 pt-4" use:enhance>
27+
<form method="POST" class="flex h-[90dvh] w-full items-center justify-center px-4" use:enhance>
2828
<Card.Root class="mx-auto w-full max-w-sm">
2929
<Card.Header>
3030
<Card.Title class="text-2xl">Create student</Card.Title>

src/routes/admin/create/building/+page.svelte

+29-31
Original file line numberDiff line numberDiff line change
@@ -23,34 +23,32 @@
2323
const { form: formData, enhance } = form;
2424
</script>
2525

26-
<div class="flex h-screen w-full items-center justify-center px-4">
27-
<form method="POST" class="flex w-full items-center justify-center px-4 pb-20" use:enhance>
28-
<Card.Root class="mx-auto w-full max-w-sm">
29-
<Card.Header>
30-
<Card.Title class="text-2xl">Create building</Card.Title>
31-
<Card.Description>Enter the name of the new building to create.</Card.Description>
32-
</Card.Header>
33-
<Card.Content class="grid gap-4">
34-
<Form.Field {form} name="building">
35-
<Form.Control>
36-
{#snippet children({ props })}
37-
<Form.Label>Building</Form.Label>
38-
<Input {...props} bind:value={$formData.building} />
39-
{/snippet}
40-
</Form.Control>
41-
<Form.FieldErrors />
42-
</Form.Field>
43-
<Form.Field {form} name="secret">
44-
<Form.Control>
45-
{#snippet children({ props })}
46-
<Form.Label>Secret</Form.Label>
47-
<Input type="password" {...props} bind:value={$formData.secret} />
48-
{/snippet}
49-
</Form.Control>
50-
<Form.FieldErrors />
51-
</Form.Field>
52-
<Form.Button type="submit">Submit</Form.Button>
53-
</Card.Content>
54-
</Card.Root>
55-
</form>
56-
</div>
26+
<form method="POST" class="flex h-[90dvh] w-full items-center justify-center px-4" use:enhance>
27+
<Card.Root class="mx-auto w-full max-w-sm">
28+
<Card.Header>
29+
<Card.Title class="text-2xl">Create building</Card.Title>
30+
<Card.Description>Enter the name of the new building to create.</Card.Description>
31+
</Card.Header>
32+
<Card.Content class="grid gap-4">
33+
<Form.Field {form} name="building">
34+
<Form.Control>
35+
{#snippet children({ props })}
36+
<Form.Label>Building</Form.Label>
37+
<Input {...props} bind:value={$formData.building} />
38+
{/snippet}
39+
</Form.Control>
40+
<Form.FieldErrors />
41+
</Form.Field>
42+
<Form.Field {form} name="secret">
43+
<Form.Control>
44+
{#snippet children({ props })}
45+
<Form.Label>Secret</Form.Label>
46+
<Input type="password" {...props} bind:value={$formData.secret} />
47+
{/snippet}
48+
</Form.Control>
49+
<Form.FieldErrors />
50+
</Form.Field>
51+
<Form.Button type="submit">Submit</Form.Button>
52+
</Card.Content>
53+
</Card.Root>
54+
</form>

src/routes/admin/create/department/+page.svelte

+29-31
Original file line numberDiff line numberDiff line change
@@ -23,34 +23,32 @@
2323
const { form: formData, enhance } = form;
2424
</script>
2525

26-
<div class="flex h-screen w-full items-center justify-center px-4">
27-
<form method="POST" class="flex w-full items-center justify-center px-4 pb-20" use:enhance>
28-
<Card.Root class="mx-auto w-full max-w-sm">
29-
<Card.Header>
30-
<Card.Title class="text-2xl">Create department</Card.Title>
31-
<Card.Description>Enter the name of the new department to create.</Card.Description>
32-
</Card.Header>
33-
<Card.Content class="grid gap-4">
34-
<Form.Field {form} name="department">
35-
<Form.Control>
36-
{#snippet children({ props })}
37-
<Form.Label>Department</Form.Label>
38-
<Input {...props} bind:value={$formData.department} />
39-
{/snippet}
40-
</Form.Control>
41-
<Form.FieldErrors />
42-
</Form.Field>
43-
<Form.Field {form} name="secret">
44-
<Form.Control>
45-
{#snippet children({ props })}
46-
<Form.Label>Secret</Form.Label>
47-
<Input type="password" {...props} bind:value={$formData.secret} />
48-
{/snippet}
49-
</Form.Control>
50-
<Form.FieldErrors />
51-
</Form.Field>
52-
<Form.Button type="submit">Submit</Form.Button>
53-
</Card.Content>
54-
</Card.Root>
55-
</form>
56-
</div>
26+
<form method="POST" class="flex h-[90dvh] w-full items-center justify-center px-4" use:enhance>
27+
<Card.Root class="mx-auto w-full max-w-sm">
28+
<Card.Header>
29+
<Card.Title class="text-2xl">Create department</Card.Title>
30+
<Card.Description>Enter the name of the new department to create.</Card.Description>
31+
</Card.Header>
32+
<Card.Content class="grid gap-4">
33+
<Form.Field {form} name="department">
34+
<Form.Control>
35+
{#snippet children({ props })}
36+
<Form.Label>Department</Form.Label>
37+
<Input {...props} bind:value={$formData.department} />
38+
{/snippet}
39+
</Form.Control>
40+
<Form.FieldErrors />
41+
</Form.Field>
42+
<Form.Field {form} name="secret">
43+
<Form.Control>
44+
{#snippet children({ props })}
45+
<Form.Label>Secret</Form.Label>
46+
<Input type="password" {...props} bind:value={$formData.secret} />
47+
{/snippet}
48+
</Form.Control>
49+
<Form.FieldErrors />
50+
</Form.Field>
51+
<Form.Button type="submit">Submit</Form.Button>
52+
</Card.Content>
53+
</Card.Root>
54+
</form>

src/routes/admin/register/+page.svelte

+38-40
Original file line numberDiff line numberDiff line change
@@ -23,43 +23,41 @@
2323
const { form: formData, enhance } = form;
2424
</script>
2525

26-
<div class="flex h-screen w-full items-center justify-center px-4">
27-
<form method="POST" class="flex w-full items-center justify-center px-4 pb-20" use:enhance>
28-
<Card.Root class="mx-auto w-full max-w-sm">
29-
<Card.Header>
30-
<Card.Title class="text-2xl">Register</Card.Title>
31-
<Card.Description>Enter credentials for user registration.</Card.Description>
32-
</Card.Header>
33-
<Card.Content class="grid gap-4">
34-
<Form.Field {form} name="username">
35-
<Form.Control>
36-
{#snippet children({ props })}
37-
<Form.Label>Username</Form.Label>
38-
<Input {...props} bind:value={$formData.username} />
39-
{/snippet}
40-
</Form.Control>
41-
<Form.FieldErrors />
42-
</Form.Field>
43-
<Form.Field {form} name="password">
44-
<Form.Control>
45-
{#snippet children({ props })}
46-
<Form.Label>Password</Form.Label>
47-
<Input type="password" {...props} bind:value={$formData.password} />
48-
{/snippet}
49-
</Form.Control>
50-
<Form.FieldErrors />
51-
</Form.Field>
52-
<Form.Field {form} name="secret">
53-
<Form.Control>
54-
{#snippet children({ props })}
55-
<Form.Label>Secret</Form.Label>
56-
<Input type="password" {...props} bind:value={$formData.secret} />
57-
{/snippet}
58-
</Form.Control>
59-
<Form.FieldErrors />
60-
</Form.Field>
61-
<Form.Button type="submit">Submit</Form.Button>
62-
</Card.Content>
63-
</Card.Root>
64-
</form>
65-
</div>
26+
<form method="POST" class="flex h-[90dvh] w-full items-center justify-center px-4" use:enhance>
27+
<Card.Root class="mx-auto w-full max-w-sm">
28+
<Card.Header>
29+
<Card.Title class="text-2xl">Register</Card.Title>
30+
<Card.Description>Enter credentials for user registration.</Card.Description>
31+
</Card.Header>
32+
<Card.Content class="grid gap-4">
33+
<Form.Field {form} name="username">
34+
<Form.Control>
35+
{#snippet children({ props })}
36+
<Form.Label>Username</Form.Label>
37+
<Input {...props} bind:value={$formData.username} />
38+
{/snippet}
39+
</Form.Control>
40+
<Form.FieldErrors />
41+
</Form.Field>
42+
<Form.Field {form} name="password">
43+
<Form.Control>
44+
{#snippet children({ props })}
45+
<Form.Label>Password</Form.Label>
46+
<Input type="password" {...props} bind:value={$formData.password} />
47+
{/snippet}
48+
</Form.Control>
49+
<Form.FieldErrors />
50+
</Form.Field>
51+
<Form.Field {form} name="secret">
52+
<Form.Control>
53+
{#snippet children({ props })}
54+
<Form.Label>Secret</Form.Label>
55+
<Input type="password" {...props} bind:value={$formData.secret} />
56+
{/snippet}
57+
</Form.Control>
58+
<Form.FieldErrors />
59+
</Form.Field>
60+
<Form.Button type="submit">Submit</Form.Button>
61+
</Card.Content>
62+
</Card.Root>
63+
</form>

0 commit comments

Comments
 (0)