mirror of
https://github.com/seanmorley15/AdventureLog.git
synced 2025-07-21 13:59:36 +02:00
adventure card improvements
This commit is contained in:
parent
704eb6f6de
commit
2ca24b9f15
6 changed files with 65 additions and 47 deletions
|
@ -1,6 +1,6 @@
|
|||
<script lang="ts">
|
||||
import { deserialize } from '$app/forms';
|
||||
import type { Adventure } from '$lib/types';
|
||||
import type { Adventure, User } from '$lib/types';
|
||||
import { createEventDispatcher } from 'svelte';
|
||||
const dispatch = createEventDispatcher();
|
||||
import type { ActionResult } from '@sveltejs/kit';
|
||||
|
@ -10,6 +10,8 @@
|
|||
|
||||
let adventures: Adventure[] = [];
|
||||
|
||||
export let user: User | null;
|
||||
|
||||
onMount(async () => {
|
||||
modal = document.getElementById('my_modal_1') as HTMLDialogElement;
|
||||
if (modal) {
|
||||
|
@ -53,7 +55,7 @@
|
|||
<h1 class="text-center font-bold text-4xl mb-6">My Adventures</h1>
|
||||
<div class="flex flex-wrap gap-4 mr-4 justify-center content-center">
|
||||
{#each adventures as adventure}
|
||||
<AdventureCard type="link" {adventure} on:link={add} />
|
||||
<AdventureCard user={user ?? null} type="link" {adventure} on:link={add} />
|
||||
{/each}
|
||||
{#if adventures.length === 0}
|
||||
<p class="text-center text-lg">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue