is visited
This commit is contained in:
@@ -20,8 +20,7 @@
|
||||
groupAdventuresByDate,
|
||||
groupNotesByDate,
|
||||
groupTransportationsByDate,
|
||||
groupChecklistsByDate,
|
||||
isAdventureVisited
|
||||
groupChecklistsByDate
|
||||
} from '$lib';
|
||||
import ChecklistCard from '$lib/components/ChecklistCard.svelte';
|
||||
import ChecklistModal from '$lib/components/ChecklistModal.svelte';
|
||||
@@ -45,7 +44,7 @@
|
||||
|
||||
$: {
|
||||
numAdventures = adventures.length;
|
||||
numVisited = adventures.filter(isAdventureVisited).length;
|
||||
numVisited = adventures.filter((adventure) => adventure.is_visited).length;
|
||||
}
|
||||
|
||||
let notFound: boolean = false;
|
||||
|
||||
@@ -46,6 +46,7 @@ export const load = (async (event) => {
|
||||
name: adventure.name,
|
||||
visits: adventure.visits,
|
||||
type: adventure.type,
|
||||
is_visited: adventure.is_visited
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
<script>
|
||||
// @ts-nocheck
|
||||
|
||||
import { isAdventureVisited } from '$lib';
|
||||
import AdventureModal from '$lib/components/AdventureModal.svelte';
|
||||
import {
|
||||
DefaultMarker,
|
||||
@@ -25,8 +24,7 @@
|
||||
let showPlanned = true;
|
||||
|
||||
$: filteredMarkers = markers.filter(
|
||||
(marker) =>
|
||||
(showVisited && isAdventureVisited(marker)) || (showPlanned && !isAdventureVisited(marker))
|
||||
(marker) => (showVisited && marker.is_visited) || (showPlanned && !marker.is_visited)
|
||||
);
|
||||
|
||||
let newMarker = [];
|
||||
@@ -145,7 +143,7 @@
|
||||
standardControls
|
||||
>
|
||||
{#each filteredMarkers as marker}
|
||||
{#if isAdventureVisited(marker)}
|
||||
{#if marker.is_visited}
|
||||
<Marker
|
||||
lngLat={marker.lngLat}
|
||||
on:click={() => (clickedName = marker.name)}
|
||||
@@ -205,7 +203,7 @@
|
||||
<div class="text-lg text-black font-bold">{marker.name}</div>
|
||||
<p class="font-semibold text-black text-md">Planned</p>
|
||||
<p class="font-semibold text-black text-md">
|
||||
{$t(`adventures.activities.${marker.type}`)}}
|
||||
{$t(`adventures.activities.${marker.type}`)}
|
||||
</p>
|
||||
{#if marker.visits && marker.visits.length > 0}
|
||||
<p class="text-black text-sm">
|
||||
|
||||
Reference in New Issue
Block a user