UX: remove some unneeded UI in the favourite pane if one didn't mark favourites yes

This commit is contained in:
Pieter Vander Vennet 2024-09-10 01:11:20 +02:00
parent 003d1167ae
commit 60898a868c
2 changed files with 22 additions and 17 deletions

View file

@ -22,7 +22,7 @@
JSON.stringify(contents),
"mapcomplete-favourites-" + new Date().toISOString() + ".geojson",
{
mimetype: "application/vnd.geo+json",
mimetype: "application/vnd.geo+json"
}
)
}
@ -33,7 +33,7 @@
gpx,
"mapcomplete-favourites-" + new Date().toISOString() + ".gpx",
{
mimetype: "{gpx=application/gpx+xml}",
mimetype: "{gpx=application/gpx+xml}"
}
)
}
@ -46,14 +46,18 @@
</LoginButton>
</div>
<div class="flex flex-col" on:keypress={(e) => console.log("Got keypress", e)}>
<div class="flex flex-col">
{#if $favourites.length === 0}
<Tr t={Translations.t.favouritePoi.noneYet} />
{:else}
<Tr t={Translations.t.favouritePoi.intro.Subs({ length: $favourites?.length ?? 0 })} />
<Tr t={Translations.t.favouritePoi.introPrivacy} />
{/if}
{#each $favourites as feature (feature.properties.id)}
<FavouriteSummary {feature} {state} />
{/each}
{#if $favourites.length > 0}
<div class="mt-8 flex">
<button on:click={() => downloadGeojson()}>
<ArrowDownTray class="h-6 w-6" />
@ -64,5 +68,6 @@
<Tr t={Translations.t.favouritePoi.downloadGpx} />
</button>
</div>
{/if}
</div>
</LoginToggle>