-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Anton Lilleby <[email protected]>
- Loading branch information
Showing
7 changed files
with
83 additions
and
68 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
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
83 changes: 44 additions & 39 deletions
83
app/src/components/external/UnregistrationFormExternal.svelte
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,52 +1,57 @@ | ||
<script lang="ts"> | ||
import { dateHasPassed } from "$lib/utils/date.util"; | ||
import { Input, Button, ButtonGroup, Spinner } from "flowbite-svelte"; | ||
import type { Event } from "$models/sanity.model"; | ||
export let event: Event; | ||
export let form; | ||
export let errors; | ||
export let delayed; | ||
export let enhance; | ||
</script> | ||
|
||
<form | ||
class="mt-20 flex flex-col gap-6" | ||
method="POST" | ||
action="?/submitUnregistrationExternal" | ||
use:enhance | ||
> | ||
<input type="text" name="subject" id="subject" class="hidden" /> | ||
|
||
<div | ||
class="mb-8 flex flex-col items-start justify-center rounded-lg border p-4 dark:border-gray-700 dark:bg-gray-800 sm:p-8" | ||
{#if !dateHasPassed(event.deadline)} | ||
<form | ||
class="mt-20 flex flex-col gap-6" | ||
method="POST" | ||
action="?/submitUnregistrationExternal" | ||
use:enhance | ||
> | ||
<div class="flex flex-col items-center gap-5"> | ||
<div class="items-start-4 flex flex-col"> | ||
<h4 | ||
class="text-2xl font-bold leading-none tracking-tight text-gray-900 dark:text-white sm:text-2xl" | ||
> | ||
<h2 class="pb-4 text-base font-bold sm:text-xl">Ønsker du å melde deg av?</h2> | ||
</h4> | ||
<input type="text" name="subject" id="subject" class="hidden" /> | ||
|
||
<div | ||
class="mb-8 flex flex-col items-start justify-center rounded-lg border p-4 sm:p-8 dark:border-gray-700 dark:bg-gray-800" | ||
> | ||
<div class="flex flex-col items-center gap-5"> | ||
<div class="items-start-4 flex flex-col"> | ||
<h4 | ||
class="text-2xl font-bold leading-none tracking-tight text-gray-900 sm:text-2xl dark:text-white" | ||
> | ||
<h2 class="pb-4 text-base font-bold sm:text-xl">Ønsker du å melde deg av?</h2> | ||
</h4> | ||
|
||
<ButtonGroup class="w-100"> | ||
<Input | ||
class="bg-white" | ||
type="text" | ||
placeholder="[email protected]" | ||
name="email" | ||
bind:value={$form.email} | ||
/> | ||
<Button class="w-48" type="submit" color="light" disabled={$delayed}> | ||
Meld meg av | ||
<span class="w-3"> | ||
{#if $delayed} | ||
<Spinner color="gray" class="ml-2 " size="4" /> | ||
{/if} | ||
</span> | ||
</Button> | ||
</ButtonGroup> | ||
{#if $errors.email} | ||
<p class="text-xs text-red-600">Fyll inn gyldig epost.</p> | ||
{/if} | ||
<ButtonGroup class="w-100"> | ||
<Input | ||
class="bg-white" | ||
type="text" | ||
placeholder="[email protected]" | ||
name="email" | ||
bind:value={$form.email} | ||
/> | ||
<Button class="w-48" type="submit" color="light" disabled={$delayed}> | ||
Meld meg av | ||
<span class="w-3"> | ||
{#if $delayed} | ||
<Spinner color="gray" class="ml-2 " size="4" /> | ||
{/if} | ||
</span> | ||
</Button> | ||
</ButtonGroup> | ||
{#if $errors.email} | ||
<p class="text-xs text-red-600">Fyll inn gyldig epost.</p> | ||
{/if} | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</form> | ||
</form> | ||
{/if} |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.