1
0
Fork 0
mirror of https://github.com/seanmorley15/AdventureLog.git synced 2025-07-22 14:29:36 +02:00

feat: Add lodging types icons and update related components

This commit is contained in:
Sean Morley 2025-03-15 23:55:53 -04:00
parent a640934370
commit c2fc249c92
3 changed files with 21 additions and 11 deletions

View file

@ -324,6 +324,20 @@ export let ADVENTURE_TYPE_ICONS = {
other: '❓'
};
export let LODGING_TYPES_ICONS = {
hotel: '🏨',
hostel: '🛏️',
resort: '🏝️',
bnb: '🍳',
campground: '🏕️',
cabin: '🏚️',
apartment: '🏢',
house: '🏠',
villa: '🏡',
motel: '🚗🏨',
other: '❓'
};
export function getAdventureTypeLabel(type: string) {
// return the emoji ADVENTURE_TYPE_ICONS label for the given type if not found return ? emoji
if (type in ADVENTURE_TYPE_ICONS) {

View file

@ -203,7 +203,7 @@
"category_fetch_error": "Error fetching categories",
"new_adventure": "New Adventure",
"basic_information": "Basic Information",
"no_adventures_to_recommendations": "No adventures found. Add at leat one adventure to get recommendations.",
"no_adventures_to_recommendations": "No adventures found. Add at least one adventure to get recommendations.",
"display_name": "Display Name",
"adventure_not_found": "There are no adventures to display. Add some using the plus button at the bottom right or try changing filters!",
"no_adventures_found": "No adventures found",

View file

@ -29,7 +29,7 @@
groupChecklistsByDate,
osmTagToEmoji,
groupLodgingByDate,
ADVENTURE_TYPE_ICONS
LODGING_TYPES_ICONS
} from '$lib';
import ChecklistCard from '$lib/components/ChecklistCard.svelte';
import ChecklistModal from '$lib/components/ChecklistModal.svelte';
@ -48,8 +48,8 @@
};
function getLodgingIcon(type: string) {
if (type in ADVENTURE_TYPE_ICONS) {
return ADVENTURE_TYPE_ICONS[type as keyof typeof ADVENTURE_TYPE_ICONS];
if (type in LODGING_TYPES_ICONS) {
return LODGING_TYPES_ICONS[type as keyof typeof LODGING_TYPES_ICONS];
} else {
return '🏨';
}
@ -613,10 +613,6 @@
</div>
{/if}
{#if collection && !collection.start_date && adventures.length == 0 && transportations.length == 0 && notes.length == 0 && checklists.length == 0 && lodging.length == 0}
<NotFound error={undefined} />
{/if}
{#if collection.description}
<div class="flex justify-center mt-4 max-w-screen-lg mx-auto">
<article
@ -1111,7 +1107,7 @@
</div>
<div class="join flex items-center justify-center mt-4">
<input
class="join-item btn"
class="join-item btn btn-neutral"
type="radio"
name="options"
aria-label="Tourism"
@ -1119,7 +1115,7 @@
on:click={() => (recomendationType = 'tourism')}
/>
<input
class="join-item btn"
class="join-item btn btn-neutral"
type="radio"
name="options"
aria-label="Food"
@ -1127,7 +1123,7 @@
on:click={() => (recomendationType = 'food')}
/>
<input
class="join-item btn"
class="join-item btn btn-neutral"
type="radio"
name="options"
aria-label="Lodging"