diff --git a/frontend/src/lib/components/AdventureCard.svelte b/frontend/src/lib/components/AdventureCard.svelte index d5b2f06..4ada38b 100644 --- a/frontend/src/lib/components/AdventureCard.svelte +++ b/frontend/src/lib/components/AdventureCard.svelte @@ -20,6 +20,7 @@ import DeleteWarning from './DeleteWarning.svelte'; import ImageDisplayModal from './ImageDisplayModal.svelte'; import { isAdventureVisited, typeToString } from '$lib'; + import CardCarousel from './CardCarousel.svelte'; export let type: string; export let user: User | null; @@ -28,7 +29,6 @@ let isCollectionModalOpen: boolean = false; let isWarningModalOpen: boolean = false; - let image_url: string | null = null; export let adventure: Adventure; let activityTypes: string[] = []; @@ -120,12 +120,6 @@ dispatch('edit', adventure); } - let currentSlide = 0; - - function goToSlide(index: number) { - currentSlide = index; - } - function link() { dispatch('link', adventure); } @@ -146,48 +140,10 @@ /> {/if} -{#if image_url} - (image_url = null)} {adventure} /> -{/if} -
-
- {#if adventure.images && adventure.images.length > 0} - - {:else} - - No image available - {/if} -
+
diff --git a/frontend/src/lib/components/CardCarousel.svelte b/frontend/src/lib/components/CardCarousel.svelte new file mode 100644 index 0000000..d777933 --- /dev/null +++ b/frontend/src/lib/components/CardCarousel.svelte @@ -0,0 +1,83 @@ + + +{#if image_url} + (image_url = null)} /> +{/if} + +
+ {#if adventure_images && adventure_images.length > 0} + + {:else} + + No image available + {/if} +
diff --git a/frontend/src/lib/components/CollectionCard.svelte b/frontend/src/lib/components/CollectionCard.svelte index 519ddfd..e983aaf 100644 --- a/frontend/src/lib/components/CollectionCard.svelte +++ b/frontend/src/lib/components/CollectionCard.svelte @@ -9,7 +9,7 @@ import ArchiveArrowUp from '~icons/mdi/archive-arrow-up'; import { goto } from '$app/navigation'; - import type { Collection } from '$lib/types'; + import type { Adventure, Collection } from '$lib/types'; import { addToast } from '$lib/toasts'; import Plus from '~icons/mdi/plus'; @@ -17,14 +17,15 @@ import TrashCan from '~icons/mdi/trashcan'; import DeleteWarning from './DeleteWarning.svelte'; import ShareModal from './ShareModal.svelte'; + import ImageDisplayModal from './ImageDisplayModal.svelte'; + import CardCarousel from './CardCarousel.svelte'; const dispatch = createEventDispatcher(); export let type: String | undefined | null; + export let adventures: Adventure[] = []; let isShareModalOpen: boolean = false; - // export let type: String; - function editAdventure() { dispatch('edit', collection); } @@ -86,6 +87,7 @@
+
diff --git a/frontend/src/lib/components/RegionCard.svelte b/frontend/src/lib/components/RegionCard.svelte index 44b8878..cdfa041 100644 --- a/frontend/src/lib/components/RegionCard.svelte +++ b/frontend/src/lib/components/RegionCard.svelte @@ -57,11 +57,7 @@ class="card w-full max-w-xs sm:max-w-sm md:max-w-md lg:max-w-md xl:max-w-md bg-neutral text-neutral-content shadow-xl overflow-hidden" >
- {#if region.name_en && region.name !== region.name_en} -

{region.name} ({region.name_en})

- {:else} -

{region.name}

- {/if} +

{region.name}

{region.id}

diff --git a/frontend/src/routes/collections/+page.svelte b/frontend/src/routes/collections/+page.svelte index d675948..1563367 100644 --- a/frontend/src/routes/collections/+page.svelte +++ b/frontend/src/routes/collections/+page.svelte @@ -180,6 +180,7 @@ {collection} on:delete={deleteCollection} on:edit={editCollection} + adventures={collection.adventures} /> {/each}