fix: event detail SSR children guard, state_referenced_locally warnings, a11y warnings
This commit is contained in:
@@ -339,6 +339,7 @@
|
|||||||
<!-- Create Event Modal -->
|
<!-- Create Event Modal -->
|
||||||
{#if showCreateModal}
|
{#if showCreateModal}
|
||||||
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
||||||
|
<!-- svelte-ignore a11y_interactive_supports_focus -->
|
||||||
<div
|
<div
|
||||||
class="fixed inset-0 bg-black/60 z-50 flex items-center justify-center p-4"
|
class="fixed inset-0 bg-black/60 z-50 flex items-center justify-center p-4"
|
||||||
onkeydown={(e) => e.key === "Escape" && (showCreateModal = false)}
|
onkeydown={(e) => e.key === "Escape" && (showCreateModal = false)}
|
||||||
@@ -356,6 +357,7 @@
|
|||||||
type="button"
|
type="button"
|
||||||
class="text-light/40 hover:text-white transition-colors"
|
class="text-light/40 hover:text-white transition-colors"
|
||||||
onclick={() => (showCreateModal = false)}
|
onclick={() => (showCreateModal = false)}
|
||||||
|
aria-label="Close"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
class="material-symbols-rounded"
|
class="material-symbols-rounded"
|
||||||
@@ -453,6 +455,7 @@
|
|||||||
|
|
||||||
<!-- Color -->
|
<!-- Color -->
|
||||||
<div class="flex flex-col gap-1.5">
|
<div class="flex flex-col gap-1.5">
|
||||||
|
<!-- svelte-ignore a11y_label_has_associated_control -->
|
||||||
<label class="text-body-sm text-light/60 font-body"
|
<label class="text-body-sm text-light/60 font-body"
|
||||||
>Color</label
|
>Color</label
|
||||||
>
|
>
|
||||||
@@ -466,6 +469,7 @@
|
|||||||
: 'border-transparent hover:border-light/30'}"
|
: 'border-transparent hover:border-light/30'}"
|
||||||
style="background-color: {color}"
|
style="background-color: {color}"
|
||||||
onclick={() => (newEventColor = color)}
|
onclick={() => (newEventColor = color)}
|
||||||
|
aria-label="Select color {color}"
|
||||||
></button>
|
></button>
|
||||||
{/each}
|
{/each}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -195,6 +195,8 @@
|
|||||||
|
|
||||||
<!-- Module Content -->
|
<!-- Module Content -->
|
||||||
<div class="flex-1 overflow-auto">
|
<div class="flex-1 overflow-auto">
|
||||||
{@render children()}
|
{#if children}
|
||||||
|
{@render children()}
|
||||||
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -33,15 +33,28 @@
|
|||||||
|
|
||||||
// Edit mode
|
// Edit mode
|
||||||
let editing = $state(false);
|
let editing = $state(false);
|
||||||
let editName = $state(data.event.name);
|
let editName = $state("");
|
||||||
let editDescription = $state(data.event.description ?? "");
|
let editDescription = $state("");
|
||||||
let editStatus = $state(data.event.status);
|
let editStatus = $state<string>("planning");
|
||||||
let editStartDate = $state(data.event.start_date ?? "");
|
let editStartDate = $state("");
|
||||||
let editEndDate = $state(data.event.end_date ?? "");
|
let editEndDate = $state("");
|
||||||
let editVenueName = $state(data.event.venue_name ?? "");
|
let editVenueName = $state("");
|
||||||
let editVenueAddress = $state(data.event.venue_address ?? "");
|
let editVenueAddress = $state("");
|
||||||
let saving = $state(false);
|
let saving = $state(false);
|
||||||
|
|
||||||
|
// Sync edit fields when data changes or edit mode opens
|
||||||
|
$effect(() => {
|
||||||
|
if (editing) {
|
||||||
|
editName = data.event.name;
|
||||||
|
editDescription = data.event.description ?? "";
|
||||||
|
editStatus = data.event.status;
|
||||||
|
editStartDate = data.event.start_date ?? "";
|
||||||
|
editEndDate = data.event.end_date ?? "";
|
||||||
|
editVenueName = data.event.venue_name ?? "";
|
||||||
|
editVenueAddress = data.event.venue_address ?? "";
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// Delete confirmation
|
// Delete confirmation
|
||||||
let showDeleteConfirm = $state(false);
|
let showDeleteConfirm = $state(false);
|
||||||
let deleting = $state(false);
|
let deleting = $state(false);
|
||||||
@@ -522,6 +535,7 @@
|
|||||||
<!-- Delete Confirmation -->
|
<!-- Delete Confirmation -->
|
||||||
{#if showDeleteConfirm}
|
{#if showDeleteConfirm}
|
||||||
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
||||||
|
<!-- svelte-ignore a11y_interactive_supports_focus -->
|
||||||
<div
|
<div
|
||||||
class="fixed inset-0 bg-black/60 z-50 flex items-center justify-center p-4"
|
class="fixed inset-0 bg-black/60 z-50 flex items-center justify-center p-4"
|
||||||
onkeydown={(e) => e.key === "Escape" && (showDeleteConfirm = false)}
|
onkeydown={(e) => e.key === "Escape" && (showDeleteConfirm = false)}
|
||||||
|
|||||||
Reference in New Issue
Block a user