mirror of
https://github.com/seanmorley15/AdventureLog.git
synced 2025-07-23 06:49:37 +02:00
chore: Refactor CollectionCard component and improve dropdown menu styling
This commit is contained in:
parent
d552c50349
commit
c35795144e
3 changed files with 55 additions and 64 deletions
|
@ -112,6 +112,11 @@
|
||||||
</p>{/if}
|
</p>{/if}
|
||||||
|
|
||||||
<div class="card-actions justify-end">
|
<div class="card-actions justify-end">
|
||||||
|
{#if type == 'link'}
|
||||||
|
<button class="btn btn-primary" on:click={() => dispatch('link', collection.id)}>
|
||||||
|
<Plus class="w-5 h-5 mr-1" />
|
||||||
|
</button>
|
||||||
|
{:else}
|
||||||
<div class="dropdown dropdown-end">
|
<div class="dropdown dropdown-end">
|
||||||
<div tabindex="0" role="button" class="btn btn-neutral">
|
<div tabindex="0" role="button" class="btn btn-neutral">
|
||||||
<DotsHorizontal class="w-6 h-6" />
|
<DotsHorizontal class="w-6 h-6" />
|
||||||
|
@ -149,13 +154,9 @@
|
||||||
><TrashCan class="w-6 h-6" />Delete</button
|
><TrashCan class="w-6 h-6" />Delete</button
|
||||||
>
|
>
|
||||||
{/if}
|
{/if}
|
||||||
{#if type == 'link'}
|
|
||||||
<button class="btn btn-primary" on:click={() => dispatch('link', collection.id)}>
|
|
||||||
<Plus class="w-5 h-5 mr-1" />
|
|
||||||
</button>
|
|
||||||
{/if}
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -32,6 +32,17 @@
|
||||||
|
|
||||||
images = adventureToEdit.images || [];
|
images = adventureToEdit.images || [];
|
||||||
|
|
||||||
|
if (adventureToEdit.longitude && adventureToEdit.latitude) {
|
||||||
|
markers = [
|
||||||
|
{
|
||||||
|
lngLat: { lng: adventureToEdit.longitude, lat: adventureToEdit.latitude },
|
||||||
|
location: adventureToEdit.location || '',
|
||||||
|
name: adventureToEdit.name,
|
||||||
|
activity_type: ''
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
if (longitude && latitude) {
|
if (longitude && latitude) {
|
||||||
adventureToEdit.latitude = latitude;
|
adventureToEdit.latitude = latitude;
|
||||||
adventureToEdit.longitude = longitude;
|
adventureToEdit.longitude = longitude;
|
||||||
|
|
|
@ -98,18 +98,6 @@
|
||||||
<main class="flex-1">
|
<main class="flex-1">
|
||||||
<div class="max-w-5xl mx-auto p-4 md:p-6 lg:p-8">
|
<div class="max-w-5xl mx-auto p-4 md:p-6 lg:p-8">
|
||||||
<div class="grid gap-8">
|
<div class="grid gap-8">
|
||||||
<!-- {#if adventure.images && adventure.images.length > 0}
|
|
||||||
<div>
|
|
||||||
<img
|
|
||||||
src={adventure.images[0].image}
|
|
||||||
alt={adventure.name}
|
|
||||||
width="1200"
|
|
||||||
height="600"
|
|
||||||
class="w-full h-auto object-cover rounded-lg"
|
|
||||||
style="aspect-ratio: 1200 / 600; object-fit: cover;"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
{/if} -->
|
|
||||||
{#if adventure.images && adventure.images.length > 0}
|
{#if adventure.images && adventure.images.length > 0}
|
||||||
<div class="carousel w-full">
|
<div class="carousel w-full">
|
||||||
{#each adventure.images as image, i}
|
{#each adventure.images as image, i}
|
||||||
|
@ -136,21 +124,12 @@
|
||||||
</div>
|
</div>
|
||||||
{/each}
|
{/each}
|
||||||
</div>
|
</div>
|
||||||
{:else}
|
|
||||||
<!-- svelte-ignore a11y-img-redundant-alt -->
|
|
||||||
<img
|
|
||||||
src={'https://placehold.co/300?text=No%20Image%20Found&font=roboto'}
|
|
||||||
alt="No image available"
|
|
||||||
class="w-full h-48 object-cover"
|
|
||||||
/>
|
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
<div class="grid gap-4">
|
<div class="grid gap-4">
|
||||||
<div class="flex items-center justify-between">
|
<div class="flex items-center justify-between">
|
||||||
<div>
|
<div>
|
||||||
<h1 class="text-4xl mt-2 font-bold">{adventure.name}</h1>
|
<h1 class="text-4xl mt-2 font-bold">{adventure.name}</h1>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex items-center gap-1">
|
<div class="flex items-center gap-1">
|
||||||
{#if adventure.rating !== undefined && adventure.rating !== null}
|
{#if adventure.rating !== undefined && adventure.rating !== null}
|
||||||
<div class="flex justify-center items-center">
|
<div class="flex justify-center items-center">
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue