activity type overhaul

This commit is contained in:
Sean Morley
2024-07-17 22:06:55 -04:00
parent f03c338935
commit f38062e250
6 changed files with 76 additions and 7 deletions

View File

@@ -6,6 +6,10 @@
export let data: PageData;
function deleteAdventure(event: CustomEvent<number>) {
adventures = adventures.filter((adventure) => adventure.id !== event.detail);
}
console.log(data);
let adventures: Adventure[] = [];
if (data.props) {
@@ -18,7 +22,7 @@
{:else}
<div class="flex flex-wrap gap-4 mr-4 justify-center content-center">
{#each adventures as adventure}
<AdventureCard type={adventure.type} {adventure} />
<AdventureCard type={adventure.type} {adventure} on:delete={deleteAdventure} />
{/each}
</div>
{/if}