update to svelte 5
All checks were successful
delpoy / build-and-deploy (push) Successful in 35s

This commit is contained in:
2024-12-02 00:28:43 +01:00
parent abffa440a1
commit 95968148a6
53 changed files with 2199 additions and 2002 deletions

View File

@ -4,11 +4,11 @@
import { env } from '$env/dynamic/public';
import Select from '$lib/components/Input/Select.svelte';
let content = '';
let type = 'feedback';
let content = $state('');
let type = $state('feedback');
let submitModal: HTMLDialogElement;
let sentModal: HTMLDialogElement & { type?: string } = {};
let sentModal: HTMLDialogElement;
async function submitFeedback() {
await fetch(`${env.PUBLIC_BASE_PATH}/feedback`, {
@ -27,7 +27,12 @@
<div>
<h2 class="text-3xl text-center">Feedback & Kontakt</h2>
<form on:submit|preventDefault={() => submitModal.show()}>
<form
onsubmit={(e) => {
e.preventDefault();
submitModal.show();
}}
>
<div class="space-y-4 mt-6 mb-4">
<Select size="sm" bind:value={type}>
<option value="feedback">Feedback</option>
@ -67,9 +72,8 @@
<Input
type="submit"
value="Abschicken"
on:click={async () => {
onclick={async () => {
await submitFeedback();
sentModal.type = type;
sentModal.show();
}}
/>
@ -86,7 +90,7 @@
<form
method="dialog"
class="modal-box"
on:submit={() => {
onsubmit={() => {
content = '';
type = 'feedback';
}}
@ -94,7 +98,7 @@
<button class="btn btn-sm btn-circle btn-ghost absolute right-2 top-2"></button>
<div>
<h3 class="font-roboto font-medium text-xl">
{sentModal.type === 'feedback' ? 'Feedback' : 'Kontaktanfrage'} abgeschickt
{type === 'feedback' ? 'Feedback' : 'Kontaktanfrage'} abgeschickt
</h3>
<div class="my-4">
{#if type === 'feedback'}
@ -112,7 +116,7 @@
<form
method="dialog"
class="modal-backdrop bg-[rgba(0,0,0,.3)]"
on:submit={() => {
onsubmit={() => {
content = '';
type = 'feedback';
}}