1
0
Fork 0
mirror of https://github.com/seanmorley15/AdventureLog.git synced 2025-07-28 09:19:37 +02:00

Update AdventureCard component to include regionId and visited properties, and add country flag support

This commit is contained in:
Sean Morley 2024-04-14 20:33:58 +00:00
parent 715a4ffd87
commit a550fd58f7
10 changed files with 548 additions and 1 deletions

View file

@ -2,6 +2,7 @@
import { createEventDispatcher } from "svelte";
import locationDot from "$lib/assets/locationDot.svg";
import calendar from "$lib/assets/calendar.svg";
import { goto } from "$app/navigation";
const dispatch = createEventDispatcher();
export let type: String;
@ -12,6 +13,7 @@
export let id: Number | undefined = undefined;
export let regionId: String | undefined = undefined;
export let visited: Boolean | undefined = undefined;
export let countryCode: String | undefined = undefined;
function remove() {
dispatch("remove", id);
@ -30,6 +32,10 @@
dispatch("removeVisit", regionId);
visited = false;
}
function moreInfo() {
goto(`/worldtravel/${countryCode}/${regionId}`);
}
</script>
{#if type === "mylog"}
@ -122,6 +128,7 @@
<h2 class="card-title overflow-ellipsis">{name}</h2>
<p>{regionId}</p>
<div class="card-actions justify-end">
<button class="btn btn-info" on:click={moreInfo}>More Info</button>
{#if !visited}
<button class="btn btn-primary" on:click={markVisited}
>Mark Visited</button