refactor: Update +page.svelte to improve rendering performance and fix conditional rendering issue
This commit is contained in:
@@ -425,7 +425,8 @@
|
||||
on:typeChange={changeType}
|
||||
/>
|
||||
{/each}
|
||||
{:else if dayTransportations.length > 0}
|
||||
{/if}
|
||||
{#if dayTransportations.length > 0}
|
||||
{#each dayTransportations as transportation}
|
||||
<TransportationCard
|
||||
{transportation}
|
||||
@@ -438,17 +439,18 @@
|
||||
}}
|
||||
/>
|
||||
{/each}
|
||||
{:else}
|
||||
{/if}
|
||||
{#if dayAdventures.length == 0 && dayTransportations.length == 0}
|
||||
<p class="text-center text-lg mt-2">
|
||||
No adventures or transportaions planned for this day.
|
||||
</p>
|
||||
{/if}
|
||||
</div>
|
||||
{/each}
|
||||
<div class="flex items-center justify-center w-10/12">
|
||||
|
||||
<MapLibre
|
||||
style="https://basemaps.cartocdn.com/gl/positron-gl-style/style.json"
|
||||
class="relative aspect-[9/16] max-h-[70vh] w-full sm:aspect-video sm:max-h-full"
|
||||
class="flex items-center self-center justify-center aspect-[9/16] max-h-[70vh] sm:aspect-video sm:max-h-full w-10/12"
|
||||
standardControls
|
||||
>
|
||||
<!-- MapEvents gives you access to map events even from other components inside the map,
|
||||
@@ -474,6 +476,5 @@
|
||||
{/if}
|
||||
{/each}
|
||||
</MapLibre>
|
||||
</div>
|
||||
{/if}
|
||||
{/if}
|
||||
|
||||
Reference in New Issue
Block a user