Refactor adventure page layout and add dynamic content

This commit is contained in:
Sean Morley
2024-04-28 16:03:38 +00:00
parent c09028ae40
commit d4f94b436d
9 changed files with 165 additions and 78 deletions

View File

@@ -10,11 +10,10 @@
count = value;
});
async function add(event: CustomEvent<{ name: string; location: string }>) {
async function add(event: CustomEvent<Adventure>) {
let newAdventure: Adventure = {
name: event.detail.name,
location: event.detail.location,
date: "",
type: "mylog",
id: -1,
};
@@ -47,14 +46,7 @@
class="grid xl:grid-cols-3 lg:grid-cols-3 md:grid-cols-2 sm:grid-cols-1 gap-4 mt-4 content-center auto-cols-auto ml-6 mr-6"
>
{#each data.result as adventure (adventure.id)}
<AdventureCard
type="featured"
on:add={add}
id={adventure.id}
name={adventure.name}
location={adventure.location}
date=""
/>
<AdventureCard type="featured" on:add={add} {adventure} />
{/each}
</div>