feat: redesign collection UI with WanderLog-inspired card style

- CollectionCard: hero image with gradient overlay, title/date on
  image in white, glass pill status badges, compact stats footer,
  removes 'Open Details' button (entire card is clickable)
- collections page: clean white bg, underline tabs, 'New Collection'
  button in header, responsive grid starts at md breakpoint
- Fix empty dropdown for viewonly type, remove debug console.log,
  add aria-label to card container
This commit is contained in:
2026-03-06 15:51:19 +00:00
parent 04fb1dfb40
commit 0b514a99ea
2 changed files with 294 additions and 315 deletions

View File

@@ -1,8 +1,6 @@
<script lang="ts"> <script lang="ts">
import { createEventDispatcher } from 'svelte'; import { createEventDispatcher } from 'svelte';
import Launch from '~icons/mdi/launch';
import FileDocumentEdit from '~icons/mdi/file-document-edit'; import FileDocumentEdit from '~icons/mdi/file-document-edit';
import ArchiveArrowDown from '~icons/mdi/archive-arrow-down'; import ArchiveArrowDown from '~icons/mdi/archive-arrow-down';
import ArchiveArrowUp from '~icons/mdi/archive-arrow-up'; import ArchiveArrowUp from '~icons/mdi/archive-arrow-up';
@@ -25,7 +23,6 @@
import Eye from '~icons/mdi/eye'; import Eye from '~icons/mdi/eye';
import EyeOff from '~icons/mdi/eye-off'; import EyeOff from '~icons/mdi/eye-off';
import Check from '~icons/mdi/check'; import Check from '~icons/mdi/check';
import MapMarker from '~icons/mdi/map-marker-multiple';
import LinkIcon from '~icons/mdi/link'; import LinkIcon from '~icons/mdi/link';
import DownloadIcon from '~icons/mdi/download'; import DownloadIcon from '~icons/mdi/download';
import ContentCopy from '~icons/mdi/content-copy'; import ContentCopy from '~icons/mdi/content-copy';
@@ -98,7 +95,6 @@
} }
async function archiveCollection(is_archived: boolean) { async function archiveCollection(is_archived: boolean) {
console.log(JSON.stringify({ is_archived: is_archived }));
let res = await fetch(`/api/collections/${collection.id}/`, { let res = await fetch(`/api/collections/${collection.id}/`, {
method: 'PATCH', method: 'PATCH',
headers: { headers: {
@@ -146,6 +142,43 @@
$: locationLength = $: locationLength =
'location_count' in collection ? collection.location_count : collection.locations.length; 'location_count' in collection ? collection.location_count : collection.locations.length;
function formatCollectionDate(dateString: string) {
return new Date(dateString).toLocaleDateString('en-GB', {
timeZone: 'UTC',
month: 'short',
day: 'numeric',
year: 'numeric'
});
}
$: dateRangeString =
collection.start_date && collection.end_date
? `${formatCollectionDate(collection.start_date)} ${formatCollectionDate(collection.end_date)}`
: collection.start_date
? formatCollectionDate(collection.start_date)
: collection.end_date
? formatCollectionDate(collection.end_date)
: '';
$: days =
collection.start_date && collection.end_date
? Math.floor(
(new Date(collection.end_date).getTime() - new Date(collection.start_date).getTime()) /
(1000 * 60 * 60 * 24)
) + 1
: null;
function goToCollection() {
goto(`/collections/${collection.id}`);
}
function handleCardKeydown(event: KeyboardEvent) {
if (event.key === 'Enter' || event.key === ' ') {
event.preventDefault();
goToCollection();
}
}
async function deleteCollection() { async function deleteCollection() {
let res = await fetch(`/api/collections/${collection.id}`, { let res = await fetch(`/api/collections/${collection.id}`, {
method: 'DELETE' method: 'DELETE'
@@ -177,55 +210,70 @@
{/if} {/if}
<div <div
class="card w-full max-w-md bg-base-300 shadow hover:shadow-md transition-all duration-200 border border-base-300 group" class="bg-base-100 rounded-2xl shadow hover:shadow-xl transition-all overflow-hidden w-full cursor-pointer group"
role="link"
aria-label={collection.name}
tabindex="0"
on:click={goToCollection}
on:keydown={handleCardKeydown}
> >
<!-- Image Carousel --> <div class="relative h-56 overflow-hidden card-carousel-tall">
<div class="relative overflow-hidden rounded-t-2xl">
<CardCarousel images={location_images} name={collection.name} icon="📚" /> <CardCarousel images={location_images} name={collection.name} icon="📚" />
<div
class="absolute inset-0 bg-gradient-to-t from-black/70 via-black/20 to-transparent pointer-events-none z-10"
></div>
<!-- Status Badge Overlay --> <div class="absolute top-3 left-3 z-20 flex gap-1.5">
<div class="absolute top-2 left-4 flex items-center gap-2">
{#if collection.status === 'folder'} {#if collection.status === 'folder'}
<div class="badge badge-sm badge-neutral shadow-sm"> <div
class="flex items-center gap-1 bg-black/40 backdrop-blur-sm text-white rounded-full px-2.5 py-1 text-xs font-medium"
>
📁 {$t('adventures.folder')} 📁 {$t('adventures.folder')}
</div> </div>
{:else if collection.status === 'upcoming'} {:else if collection.status === 'upcoming'}
<div class="badge badge-sm badge-info shadow-sm"> <div
class="flex items-center gap-1 bg-black/40 backdrop-blur-sm text-white rounded-full px-2.5 py-1 text-xs font-medium"
>
🚀 {$t('adventures.upcoming')} 🚀 {$t('adventures.upcoming')}
</div> </div>
{#if collection.days_until_start !== null} {#if collection.days_until_start !== null}
<div class="badge badge-sm badge-accent shadow-sm"> <div
class="flex items-center gap-1 bg-black/40 backdrop-blur-sm text-white rounded-full px-2.5 py-1 text-xs font-medium"
>
{collection.days_until_start} {collection.days_until_start}
{collection.days_until_start === 1 ? $t('adventures.day') : $t('adventures.days')} {collection.days_until_start === 1 ? $t('adventures.day') : $t('adventures.days')}
</div> </div>
{/if} {/if}
{:else if collection.status === 'in_progress'} {:else if collection.status === 'in_progress'}
<div class="badge badge-sm badge-success shadow-sm"> <div
class="flex items-center gap-1 bg-black/40 backdrop-blur-sm text-white rounded-full px-2.5 py-1 text-xs font-medium"
>
🎯 {$t('adventures.in_progress')} 🎯 {$t('adventures.in_progress')}
</div> </div>
{:else if collection.status === 'completed'} {:else if collection.status === 'completed'}
<div class="badge badge-sm badge-primary shadow-sm"> <div
<Check class="w-4 h-4" /> class="flex items-center gap-1 bg-black/40 backdrop-blur-sm text-white rounded-full px-2.5 py-1 text-xs font-medium"
>
<Check class="w-3.5 h-3.5" />
{$t('adventures.completed')} {$t('adventures.completed')}
</div> </div>
{/if} {/if}
{#if collection.is_archived} {#if collection.is_archived}
<div class="badge badge-sm badge-warning shadow-sm"> <div
class="flex items-center gap-1 bg-black/40 backdrop-blur-sm text-white rounded-full px-2.5 py-1 text-xs font-medium"
>
{$t('adventures.archived')} {$t('adventures.archived')}
</div> </div>
{/if} {/if}
</div> </div>
<!-- Privacy Indicator --> <div class="absolute top-3 right-3 z-20 flex items-center gap-1.5">
<div class="absolute top-2 right-4">
<div <div
class="tooltip tooltip-left" class="tooltip tooltip-left"
data-tip={collection.is_public ? $t('adventures.public') : $t('adventures.private')} data-tip={collection.is_public ? $t('adventures.public') : $t('adventures.private')}
> >
<div <div
class="badge badge-sm {collection.is_public class="flex items-center justify-center bg-black/40 backdrop-blur-sm text-white rounded-full w-7 h-7"
? 'badge-secondary'
: 'badge-ghost'} shadow-lg"
aria-label={collection.is_public ? $t('adventures.public') : $t('adventures.private')} aria-label={collection.is_public ? $t('adventures.public') : $t('adventures.private')}
> >
{#if collection.is_public} {#if collection.is_public}
@@ -235,225 +283,171 @@
{/if} {/if}
</div> </div>
</div> </div>
</div>
</div>
<!-- Content --> {#if user && user.uuid == collection.user && type != 'link' && type != 'viewonly'}
<div class="card-body p-4 space-y-3"> <div class="dropdown dropdown-end">
<!-- Title --> <button
<a type="button"
href="/collections/{collection.id}" class="btn btn-ghost bg-black/40 backdrop-blur-sm text-white rounded-full w-7 h-7 p-0 min-h-0 border-0 hover:bg-black/55"
class="hover:text-primary transition-colors duration-200 line-clamp-2 text-lg font-semibold" on:click|stopPropagation
>{collection.name}</a >
> <DotsHorizontal class="w-4 h-4" />
</button>
<!-- Stats --> <ul
<div class="flex flex-wrap items-center gap-2 text-sm text-base-content/70"> class="dropdown-content menu bg-base-100 rounded-box z-[1] w-64 p-2 shadow-xl border border-base-300 mt-1"
<!-- Location Count --> >
<div class="flex items-center gap-1"> {#if type != 'viewonly'}
<MapMarker class="w-4 h-4 text-primary" /> <li>
<span> <button class="flex items-center gap-2" on:click|stopPropagation={editAdventure}>
{locationLength} <FileDocumentEdit class="w-4 h-4" />
{locationLength === 1 ? $t('locations.location') : $t('locations.locations')} {$t('adventures.edit_collection')}
</span> </button>
</div> </li>
<li>
<!-- Date Range & Duration --> <button
{#if collection.start_date && collection.end_date} class="flex items-center gap-2"
<span class="text-base-content/60 px-1"></span> on:click|stopPropagation={() => (isShareModalOpen = true)}
<div class="flex items-center gap-1"> >
<span> <ShareVariant class="w-4 h-4" />
{Math.floor( {$t('adventures.share')}
(new Date(collection.end_date).getTime() - </button>
new Date(collection.start_date).getTime()) / </li>
(1000 * 60 * 60 * 24) {#if collection.is_public}
) + 1} <li>
{Math.floor( <button on:click|stopPropagation={copyLink} class="flex items-center gap-2">
(new Date(collection.end_date).getTime() - {#if copied}
new Date(collection.start_date).getTime()) / <Check class="w-4 h-4 text-success" />
(1000 * 60 * 60 * 24) <span>{$t('adventures.link_copied')}</span>
) + {:else}
1 === <LinkIcon class="w-4 h-4" />
1 {$t('adventures.copy_link')}
? $t('adventures.day') {/if}
: $t('adventures.days')} </button>
</span> </li>
{/if}
{#if collection.is_archived}
<li>
<button
class="flex items-center gap-2"
on:click|stopPropagation={() => archiveCollection(false)}
>
<ArchiveArrowUp class="w-4 h-4" />
{$t('adventures.unarchive')}
</button>
</li>
{:else}
<li>
<button
class="flex items-center gap-2"
on:click|stopPropagation={() => archiveCollection(true)}
>
<ArchiveArrowDown class="w-4 h-4" />
{$t('adventures.archive')}
</button>
</li>
{/if}
<li>
<button
class="flex items-center gap-2"
on:click|stopPropagation={exportCollectionZip}
>
<DownloadIcon class="w-4 h-4" />
{$t('adventures.export_zip')}
</button>
</li>
<li>
<button
class="flex items-center gap-2"
on:click|stopPropagation={duplicateCollection}
disabled={isDuplicating}
>
<ContentCopy class="w-4 h-4" />
{isDuplicating ? '...' : $t('adventures.duplicate')}
</button>
</li>
<div class="divider my-1"></div>
<li>
<button
id="delete_collection"
data-umami-event="Delete Collection"
class="text-error flex items-center gap-2"
on:click|stopPropagation={() => (isWarningModalOpen = true)}
>
<TrashCan class="w-4 h-4" />
{$t('adventures.delete')}
</button>
</li>
{/if}
</ul>
</div>
{:else if user && collection.shared_with && collection.shared_with.includes(user.uuid) && type != 'link'}
<div class="dropdown dropdown-end">
<button
type="button"
class="btn btn-ghost bg-black/40 backdrop-blur-sm text-white rounded-full w-7 h-7 p-0 min-h-0 border-0 hover:bg-black/55"
on:click|stopPropagation
>
<DotsHorizontal class="w-4 h-4" />
</button>
<ul
class="dropdown-content menu bg-base-100 rounded-box z-[1] w-64 p-2 shadow-xl border border-base-300 mt-1"
>
<li>
<button
class="text-error flex items-center gap-2"
on:click|stopPropagation={() => dispatch('leave', collection.id)}
>
<ExitRun class="w-4 h-4" />
{$t('adventures.leave_collection')}
</button>
</li>
</ul>
</div> </div>
{/if} {/if}
</div> </div>
<!-- Date Range (if exists) --> <div class="absolute bottom-0 left-0 right-0 p-4 z-20 pointer-events-none">
{#if collection.start_date && collection.end_date} <h3 class="text-white font-bold text-base leading-snug line-clamp-2 drop-shadow-sm">
<div class="text-xs text-base-content/60"> {collection.name}
{new Date(collection.start_date).toLocaleDateString('en-GB', { </h3>
timeZone: 'UTC', {#if collection.start_date || collection.end_date}
month: 'short', <p class="text-white/75 text-xs mt-0.5 drop-shadow-sm">{dateRangeString}</p>
day: 'numeric', {/if}
year: 'numeric' </div>
})} {new Date(collection.end_date).toLocaleDateString('en-GB', {
timeZone: 'UTC',
month: 'short',
day: 'numeric',
year: 'numeric'
})}
</div>
{/if}
<!-- Actions --> {#if type == 'link'}
<div class="pt-4 border-t border-base-300"> <div class="absolute bottom-3 right-3 z-20">
{#if type == 'link'}
{#if linkedCollectionList && linkedCollectionList {#if linkedCollectionList && linkedCollectionList
.map(String) .map(String)
.includes(String(collection.id))} .includes(String(collection.id))}
<button <button
class="btn btn-error btn-block" class="btn btn-xs border-0 bg-black/40 backdrop-blur-sm text-white rounded-full px-3 hover:bg-black/55"
on:click={() => dispatch('unlink', collection.id)} on:click|stopPropagation={() => dispatch('unlink', collection.id)}
> >
<Minus class="w-4 h-4" /> <Minus class="w-3.5 h-3.5" />
{$t('adventures.remove_from_collection')} {$t('adventures.remove_from_collection')}
</button> </button>
{:else} {:else}
<button <button
class="btn btn-primary btn-block" class="btn btn-xs border-0 bg-black/40 backdrop-blur-sm text-white rounded-full px-3 hover:bg-black/55"
on:click={() => dispatch('link', collection.id)} on:click|stopPropagation={() => dispatch('link', collection.id)}
> >
<Plus class="w-4 h-4" /> <Plus class="w-3.5 h-3.5" />
{$t('adventures.add_to_collection')} {$t('adventures.add_to_collection')}
</button> </button>
{/if} {/if}
{:else} </div>
<div class="flex justify-between items-center"> {/if}
<button </div>
class="btn btn-neutral btn-sm flex-1 mr-2"
on:click={() => goto(`/collections/${collection.id}`)} <div class="px-4 py-3 flex items-center gap-3 text-sm text-base-content/60">
> <span
<Launch class="w-4 h-4" /> >{locationLength}
{$t('adventures.open_details')} {locationLength !== 1 ? $t('locations.locations') : $t('locations.location')}</span
</button> >
{#if user && user.uuid == collection.user} {#if days}
<div class="dropdown dropdown-end"> <span>· {days} {days !== 1 ? $t('adventures.days') : $t('adventures.day')}</span>
<button type="button" class="btn btn-square btn-sm btn-base-300"> {/if}
<DotsHorizontal class="w-5 h-5" />
</button>
<ul
class="dropdown-content menu bg-base-100 rounded-box z-[1] w-64 p-2 shadow-xl border border-base-300"
>
{#if type != 'viewonly'}
<li>
<button class="flex items-center gap-2" on:click={editAdventure}>
<FileDocumentEdit class="w-4 h-4" />
{$t('adventures.edit_collection')}
</button>
</li>
<li>
<button
class="flex items-center gap-2"
on:click={() => (isShareModalOpen = true)}
>
<ShareVariant class="w-4 h-4" />
{$t('adventures.share')}
</button>
</li>
{#if collection.is_public}
<li>
<button on:click={copyLink} class="flex items-center gap-2">
{#if copied}
<Check class="w-4 h-4 text-success" />
<span>{$t('adventures.link_copied')}</span>
{:else}
<LinkIcon class="w-4 h-4" />
{$t('adventures.copy_link')}
{/if}
</button>
</li>
{/if}
{#if collection.is_archived}
<li>
<button
class="flex items-center gap-2"
on:click={() => archiveCollection(false)}
>
<ArchiveArrowUp class="w-4 h-4" />
{$t('adventures.unarchive')}
</button>
</li>
{:else}
<li>
<button
class="flex items-center gap-2"
on:click={() => archiveCollection(true)}
>
<ArchiveArrowDown class="w-4 h-4" />
{$t('adventures.archive')}
</button>
</li>
{/if}
<li>
<button class="flex items-center gap-2" on:click={exportCollectionZip}>
<DownloadIcon class="w-4 h-4" />
{$t('adventures.export_zip')}
</button>
</li>
<li>
<button
class="flex items-center gap-2"
on:click={duplicateCollection}
disabled={isDuplicating}
>
<ContentCopy class="w-4 h-4" />
{isDuplicating ? '...' : $t('adventures.duplicate')}
</button>
</li>
<div class="divider my-1"></div>
<li>
<button
id="delete_collection"
data-umami-event="Delete Collection"
class="text-error flex items-center gap-2"
on:click={() => (isWarningModalOpen = true)}
>
<TrashCan class="w-4 h-4" />
{$t('adventures.delete')}
</button>
</li>
{/if}
{#if type == 'viewonly'}
<li>
<button
class="flex items-center gap-2"
on:click={() => goto(`/collections/${collection.id}`)}
>
<Launch class="w-4 h-4" />
{$t('adventures.open_details')}
</button>
</li>
{/if}
</ul>
</div>
{:else if user && collection.shared_with && collection.shared_with.includes(user.uuid)}
<!-- dropdown with leave button -->
<div class="dropdown dropdown-end">
<button type="button" class="btn btn-square btn-sm btn-base-300">
<DotsHorizontal class="w-5 h-5" />
</button>
<ul
class="dropdown-content menu bg-base-100 rounded-box z-[1] w-64 p-2 shadow-xl border border-base-300"
>
<li>
<button
class="text-error flex items-center gap-2"
on:click={() => dispatch('leave', collection.id)}
>
<ExitRun class="w-4 h-4" />
{$t('adventures.leave_collection')}
</button>
</li>
</ul>
</div>
{/if}
</div>
{/if}
</div>
</div> </div>
</div> </div>
@@ -465,4 +459,12 @@
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
overflow: hidden; overflow: hidden;
} }
.card-carousel-tall :global(figure),
.card-carousel-tall :global(.carousel),
.card-carousel-tall :global(.carousel-item),
.card-carousel-tall :global(img),
.card-carousel-tall :global(figure > div) {
height: 14rem;
}
</style> </style>

View File

@@ -3,9 +3,7 @@
import { goto } from '$app/navigation'; import { goto } from '$app/navigation';
import { page } from '$app/stores'; import { page } from '$app/stores';
import CollectionCard from '$lib/components/cards/CollectionCard.svelte'; import CollectionCard from '$lib/components/cards/CollectionCard.svelte';
import CollectionLink from '$lib/components/CollectionLink.svelte';
import CollectionModal from '$lib/components/CollectionModal.svelte'; import CollectionModal from '$lib/components/CollectionModal.svelte';
import NotFound from '$lib/components/NotFound.svelte';
import type { Collection, CollectionInvite, SlimCollection } from '$lib/types'; import type { Collection, CollectionInvite, SlimCollection } from '$lib/types';
import { t } from 'svelte-i18n'; import { t } from 'svelte-i18n';
@@ -22,7 +20,6 @@
import DeleteWarning from '$lib/components/DeleteWarning.svelte'; import DeleteWarning from '$lib/components/DeleteWarning.svelte';
export let data: any; export let data: any;
console.log('Collections page data:', data);
let collections: SlimCollection[] = data.props.adventures || []; let collections: SlimCollection[] = data.props.adventures || [];
let sharedCollections: SlimCollection[] = data.props.sharedCollections || []; let sharedCollections: SlimCollection[] = data.props.sharedCollections || [];
@@ -377,105 +374,87 @@
</dialog> </dialog>
{/if} {/if}
<div class="min-h-screen bg-gradient-to-br from-base-200 via-base-100 to-base-200"> <div class="min-h-screen bg-base-100">
<div class="drawer lg:drawer-open"> <div class="drawer lg:drawer-open">
<input id="my-drawer" type="checkbox" class="drawer-toggle" bind:checked={sidebarOpen} /> <input id="my-drawer" type="checkbox" class="drawer-toggle" bind:checked={sidebarOpen} />
<div class="drawer-content"> <div class="drawer-content">
<!-- Header Section --> <!-- Header Section -->
<div class="sticky top-0 z-40 bg-base-100/80 backdrop-blur-lg border-b border-base-300"> <div class="sticky top-0 z-40 bg-base-100/95 backdrop-blur-md border-b border-base-200">
<div class="container mx-auto px-6 py-4"> <div class="container mx-auto px-6 py-4">
<div class="flex items-center justify-between"> <div class="flex items-center justify-between gap-3">
<div class="flex items-center gap-4"> <div class="flex items-center gap-3">
<button class="btn btn-ghost btn-square lg:hidden" on:click={toggleSidebar}> <button class="btn btn-ghost btn-square lg:hidden" on:click={toggleSidebar}>
<Filter class="w-5 h-5" /> <Filter class="w-5 h-5" />
</button> </button>
<div class="flex items-center gap-3"> <h1 class="text-2xl font-bold">Collections</h1>
<div class="p-2 bg-primary/10 rounded-xl">
<CollectionIcon class="w-8 h-8 text-primary" />
</div>
<div>
<h1 class="text-3xl font-bold bg-clip-text text-primary">
{activeView === 'invites'
? $t('invites.title')
: $t(`adventures.my_collections`)}
</h1>
<p class="text-sm text-base-content/60">
{currentCount}
{activeView === 'owned'
? $t('navbar.collections')
: activeView === 'shared'
? $t('collection.shared_collections')
: activeView === 'archived'
? $t('adventures.archived_collections')
: $t('invites.pending_invites')}
</p>
</div>
</div>
</div> </div>
<!-- View Toggle --> <button
<div class="tabs tabs-boxed bg-base-200"> class="btn btn-primary btn-sm gap-2"
<button on:click={() => {
class="tab gap-2 {activeView === 'owned' ? 'tab-active' : ''}" collectionToEdit = null;
on:click={() => switchView('owned')} isShowingCollectionModal = true;
> newType = 'visited';
<CollectionIcon class="w-4 h-4" /> }}
<span class="hidden sm:inline">{$t('adventures.my_collections')}</span> >
<div <Plus class="w-4 h-4" />
class="badge badge-sm {activeView === 'owned' ? 'badge-primary' : 'badge-ghost'}" {$t('collection.create')}
> </button>
{collections.length} </div>
</div>
</button> <div class="flex border-b border-base-200 mt-4 overflow-x-auto">
<button <button
class="tab gap-2 {activeView === 'shared' ? 'tab-active' : ''}" class="tab px-4 py-2 text-sm font-medium border-b-2 transition-colors whitespace-nowrap {activeView ===
on:click={() => switchView('shared')} 'owned'
> ? 'border-primary text-primary'
<Share class="w-4 h-4" /> : 'border-transparent text-base-content/60 hover:text-base-content'}"
<span class="hidden sm:inline">{$t('share.shared')}</span> on:click={() => switchView('owned')}
<div >
class="badge badge-sm {activeView === 'shared' ? 'badge-primary' : 'badge-ghost'}" <CollectionIcon class="w-4 h-4" />
> <span class="hidden sm:inline">{$t('adventures.my_collections')}</span>
{sharedCollections.length} <div class="badge badge-sm badge-ghost">{collections.length}</div>
</div> </button>
</button> <button
<button class="tab px-4 py-2 text-sm font-medium border-b-2 transition-colors whitespace-nowrap {activeView ===
class="tab gap-2 {activeView === 'archived' ? 'tab-active' : ''}" 'shared'
on:click={() => switchView('archived')} ? 'border-primary text-primary'
> : 'border-transparent text-base-content/60 hover:text-base-content'}"
<Archive class="w-4 h-4" /> on:click={() => switchView('shared')}
<span class="hidden sm:inline">{$t('adventures.archived')}</span> >
<div <Share class="w-4 h-4" />
class="badge badge-sm {activeView === 'archived' <span class="hidden sm:inline">{$t('share.shared')}</span>
? 'badge-primary' <div class="badge badge-sm badge-ghost">{sharedCollections.length}</div>
: 'badge-ghost'}" </button>
> <button
{archivedCollections.length} class="tab px-4 py-2 text-sm font-medium border-b-2 transition-colors whitespace-nowrap {activeView ===
</div> 'archived'
</button> ? 'border-primary text-primary'
<button : 'border-transparent text-base-content/60 hover:text-base-content'}"
class="tab gap-2 {activeView === 'invites' ? 'tab-active' : ''}" on:click={() => switchView('archived')}
on:click={() => switchView('invites')} >
> <Archive class="w-4 h-4" />
<div class="indicator"> <span class="hidden sm:inline">{$t('adventures.archived')}</span>
<MailIcon class="w-4 h-4" /> <div class="badge badge-sm badge-ghost">{archivedCollections.length}</div>
{#if invites.length > 0} </button>
<span class="indicator-item badge badge-xs badge-error"></span> <button
{/if} class="tab px-4 py-2 text-sm font-medium border-b-2 transition-colors whitespace-nowrap {activeView ===
</div> 'invites'
<span class="hidden sm:inline">{$t('invites.title')}</span> ? 'border-primary text-primary'
<div : 'border-transparent text-base-content/60 hover:text-base-content'}"
class="badge badge-sm {activeView === 'invites' on:click={() => switchView('invites')}
? 'badge-primary' >
: invites.length > 0 <div class="indicator">
? 'badge-error' <MailIcon class="w-4 h-4" />
: 'badge-ghost'}" {#if invites.length > 0}
> <span class="indicator-item badge badge-xs badge-error"></span>
{invites.length} {/if}
</div> </div>
</button> <span class="hidden sm:inline">{$t('invites.title')}</span>
</div> <div class="badge badge-sm {invites.length > 0 ? 'badge-error' : 'badge-ghost'}">
{invites.length}
</div>
</button>
</div> </div>
</div> </div>
</div> </div>
@@ -588,9 +567,7 @@
</div> </div>
{:else} {:else}
<!-- Collections Grid --> <!-- Collections Grid -->
<div <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-5">
class="grid grid-cols-1 sm:grid-cols-1 lg:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4 gap-6"
>
{#each currentCollections as collection (collection.id)} {#each currentCollections as collection (collection.id)}
<CollectionCard <CollectionCard
type="" type=""