Fix custom default category

This commit is contained in:
Sean Morley
2024-11-26 15:10:17 -05:00
parent 17d8784d8c
commit ce0b82acb7
10 changed files with 66 additions and 26 deletions

View File

@@ -361,8 +361,7 @@
</div>
<div class="divider"></div>
<div class="form-control">
<br />
<p class="text-lg font-semibold mt-2 mb-2">{$t('adventures.sources')}</p>
<p class="text-lg font-semibold mb-2">{$t('adventures.sources')}</p>
<label class="label cursor-pointer">
<span class="label-text">{$t('adventures.collection_adventures')}</span>
<input

View File

@@ -265,9 +265,7 @@
<div>
<p class="text-sm text-muted-foreground">{$t('adventures.adventure_type')}</p>
<p class="text-base font-medium">
{typeof adventure.category === 'object'
? `${adventure.category.display_name} ${adventure.category.icon}`
: ''}
{adventure.category?.display_name + ' ' + adventure.category?.icon}
</p>
</div>
{#if data.props.collection}
@@ -339,8 +337,7 @@
<Popup openOn="click" offset={[0, -10]}>
<div class="text-lg text-black font-bold">{adventure.name}</div>
<p class="font-semibold text-black text-md">
{typeof adventure.category === 'object' && adventure.category.display_name}
{typeof adventure.category === 'object' && adventure.category.icon}
{adventure.category?.display_name + ' ' + adventure.category?.icon}
</p>
{#if adventure.visits.length > 0}
<p class="text-black text-sm">

View File

@@ -126,7 +126,7 @@
on:click={togglePopup}
>
<span class="text-xl">
{typeof adventure.category === 'object' ? adventure.category.icon : adventure.category}
{adventure.category?.display_name + ' ' + adventure.category?.icon}
</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">
{adventure.category.display_name + ' ' + adventure.category.icon}
{adventure.category?.display_name + ' ' + adventure.category?.icon}
</p>
{#if adventure.visits && adventure.visits.length > 0}
<p class="text-black text-sm">