Add the ability to add participants to already created events
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
<script lang="ts">
|
||||
let { event = $bindable() } = $props();
|
||||
let { event = $bindable(), readonly = false } = $props();
|
||||
|
||||
let loading = $state(false);
|
||||
let showForm = $derived(!event.name || !event.date);
|
||||
let showForm = $derived((!event.name || !event.date) && !readonly);
|
||||
|
||||
function handleSubmit(e: Event) {
|
||||
e.preventDefault();
|
||||
@@ -18,7 +18,9 @@
|
||||
}
|
||||
|
||||
function showEditForm() {
|
||||
showForm = true;
|
||||
if (!readonly) {
|
||||
showForm = true;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -59,13 +61,15 @@
|
||||
{/if}
|
||||
|
||||
{#if !showForm}
|
||||
<button
|
||||
class="mb-4 w-full rounded bg-blue-600 py-2 text-white transition hover:bg-blue-700"
|
||||
onclick={showEditForm}
|
||||
aria-label="Edit event"
|
||||
>
|
||||
Edit the event
|
||||
</button>
|
||||
{#if !readonly}
|
||||
<button
|
||||
class="mb-4 w-full rounded bg-blue-600 py-2 text-white transition hover:bg-blue-700"
|
||||
onclick={showEditForm}
|
||||
aria-label="Edit event"
|
||||
>
|
||||
Edit the event
|
||||
</button>
|
||||
{/if}
|
||||
<div class="rounded border border-gray-300 bg-white p-4">
|
||||
<h2 class="mb-2 text-xl font-bold">Event Preview</h2>
|
||||
{#if Object.keys(event).length > 0}
|
||||
|
||||
Reference in New Issue
Block a user