Refactor adventure category handling: update type definitions, enhance category management in UI components, and implement user-specific category deletion logic in the backend

This commit is contained in:
Sean Morley
2024-11-23 13:42:41 -05:00
parent 736ede2417
commit 8e5a20ec62
12 changed files with 324 additions and 93 deletions

View File

@@ -126,7 +126,7 @@
on:click={togglePopup}
>
<span class="text-xl">
{getAdventureTypeLabel(adventure.type)}
{typeof adventure.category === 'object' ? adventure.category.icon : adventure.category}
</span>
{#if isPopupOpen}
<Popup openOn="click" offset={[0, -10]} on:close={() => (isPopupOpen = false)}>
@@ -138,7 +138,7 @@
{adventure.is_visited ? $t('adventures.visited') : $t('adventures.planned')}
</p>
<p class="font-semibold text-black text-md">
{$t(`adventures.activities.${adventure.type}`)}
{adventure.category.display_name + ' ' + adventure.category.icon}
</p>
{#if adventure.visits && adventure.visits.length > 0}
<p class="text-black text-sm">