From f0894a964f9ad7ec56c7df09a3710009e7f8a73e Mon Sep 17 00:00:00 2001 From: Sean Morley Date: Tue, 2 Apr 2024 21:33:41 +0000 Subject: [PATCH] Refactor AdventureCard component and remove FeaturedAdventureCard --- src/lib/components/AdventureCard.svelte | 28 +++++++++++++++++++ .../components/FeaturedAdventureCard.svelte | 24 ---------------- src/routes/featured/+page.svelte | 4 +-- src/routes/log/+page.svelte | 2 +- 4 files changed, 31 insertions(+), 27 deletions(-) delete mode 100644 src/lib/components/FeaturedAdventureCard.svelte diff --git a/src/lib/components/AdventureCard.svelte b/src/lib/components/AdventureCard.svelte index a94b0be..f185407 100644 --- a/src/lib/components/AdventureCard.svelte +++ b/src/lib/components/AdventureCard.svelte @@ -4,6 +4,8 @@ import calendar from "$lib/assets/calendar.svg"; const dispatch = createEventDispatcher(); + export let type:String; + export let name:String; export let location:String; export let created:string; @@ -15,13 +17,22 @@ function edit() { dispatch('edit', id) } + function add() { + dispatch('add', {name, location}); + } +{#if type === 'mylog'} +

{name}

+ {#if location !== ""}

Logo{location}

+ {/if} + {#if created !== ""}

Logo{created}

+ {/if}
@@ -29,3 +40,20 @@
+{/if} + +{#if type === 'featured'} + +
+
+

{name}

+ {#if location!=""} +

Logo{location}

+ {/if} +
+ +
+
+
+ +{/if} \ No newline at end of file diff --git a/src/lib/components/FeaturedAdventureCard.svelte b/src/lib/components/FeaturedAdventureCard.svelte deleted file mode 100644 index a442402..0000000 --- a/src/lib/components/FeaturedAdventureCard.svelte +++ /dev/null @@ -1,24 +0,0 @@ - - -
-
-

{name}

-

Logo{location}

-
- -
-
-
- diff --git a/src/routes/featured/+page.svelte b/src/routes/featured/+page.svelte index 4099954..df1be87 100644 --- a/src/routes/featured/+page.svelte +++ b/src/routes/featured/+page.svelte @@ -1,7 +1,7 @@