Feature(grb): add popup feature to validate e.g. a user profile

This commit is contained in:
Pieter Vander Vennet 2025-03-17 01:17:02 +01:00
parent c3d905b26a
commit ecd8f5e1da
11 changed files with 247 additions and 64 deletions

View file

@ -6,18 +6,26 @@
export let osmConnection: OsmConnection
export let clss: string | undefined = undefined
/**
* Show the button, even though we are logged in
*/
export let forceShow: boolean = false
export let msg: String = undefined
if (osmConnection === undefined) {
console.error("No osmConnection passed into loginButton")
}
let isLoggedIn = osmConnection.isLoggedIn
</script>
{#if !$isLoggedIn}
{#if !$isLoggedIn || forceShow}
<button class={clss} on:click={() => osmConnection.AttemptLogin()} style="margin-left: 0">
<ArrowLeftOnRectangle class="m-1 w-12" />
<slot>
<Tr t={Translations.t.general.loginWithOpenStreetMap} />
{#if msg}
{msg}
{:else}
<Tr t={Translations.t.general.loginWithOpenStreetMap} />
{/if}
</slot>
</button>
{/if}