diff --git a/src/lib/components/AdventureCard.svelte b/src/lib/components/AdventureCard.svelte index e5bed98..0cdd8a1 100644 --- a/src/lib/components/AdventureCard.svelte +++ b/src/lib/components/AdventureCard.svelte @@ -31,6 +31,10 @@ console.log(adventure.id); goto(`/adventure/${adventure.id}`); } + function markVisited() { + console.log(adventure.id); + dispatch("markVisited", adventure); + }
{/if} {#if type == "planner"} + { @@ -25,7 +26,7 @@ }); function create() { - addActivityType(); + activitySetup(); if (newAdventure.name.trim() === "") { alert("Name is required"); return; @@ -46,15 +47,9 @@ let activityInput: string = ""; - function addActivityType() { - if (activityInput.trim() !== "") { - const activities = activityInput - .split(" ") - .filter((activity) => activity.trim() !== ""); - newAdventure.activityTypes = activities; - activityInput = ""; - } - console.log(newAdventure.activityTypes); + function activitySetup() { + newAdventure = addActivityType(activityInput, newAdventure); + activityInput = ""; } diff --git a/src/lib/components/EditModal.svelte b/src/lib/components/EditModal.svelte index b566521..8935d3a 100644 --- a/src/lib/components/EditModal.svelte +++ b/src/lib/components/EditModal.svelte @@ -4,6 +4,7 @@ import type { Adventure } from "$lib/utils/types"; const dispatch = createEventDispatcher(); import { onMount } from "svelte"; + import { addActivityType } from "$lib"; let modal: HTMLDialogElement; console.log(adventureToEdit.id); @@ -19,7 +20,7 @@ }); function submit() { - addActivityType(); + activitySetup(); dispatch("submit", adventureToEdit); console.log(adventureToEdit); } @@ -36,15 +37,9 @@ let activityInput: string = ""; - function addActivityType() { - if (activityInput.trim() !== "") { - const activities = activityInput - .split(",") - .filter((activity) => activity.trim() !== ""); - adventureToEdit.activityTypes = activities; - activityInput = ""; - } - console.log(adventureToEdit.activityTypes); + function activitySetup() { + adventureToEdit = addActivityType(activityInput, adventureToEdit); + activityInput = ""; } diff --git a/src/lib/components/Navbar copy.svelte b/src/lib/components/Navbar copy.svelte new file mode 100644 index 0000000..7efe33f --- /dev/null +++ b/src/lib/components/Navbar copy.svelte @@ -0,0 +1,169 @@ + + + diff --git a/src/lib/components/Navbar.svelte b/src/lib/components/Navbar.svelte index 7efe33f..fdffc6d 100644 --- a/src/lib/components/Navbar.svelte +++ b/src/lib/components/Navbar.svelte @@ -68,55 +68,90 @@ } -