MapComplete/src/UI/Base/LoginButton.svelte

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

24 lines
771 B
Svelte
Raw Normal View History

<script lang="ts">
import { OsmConnection } from "../../Logic/Osm/OsmConnection"
import Translations from "../i18n/Translations.js"
import Tr from "./Tr.svelte"
2024-06-17 04:27:08 +02:00
import ArrowLeftOnRectangle from "@babeard/svelte-heroicons/solid/ArrowLeftOnRectangle"
export let osmConnection: OsmConnection
export let clss: string | undefined = undefined
2024-06-16 16:06:26 +02:00
if (osmConnection === undefined) {
console.error("No osmConnection passed into loginButton")
}
let isLoggedIn = osmConnection.isLoggedIn
</script>
{#if !$isLoggedIn}
<button class={clss} on:click={() => osmConnection.AttemptLogin()} style="margin-left: 0">
<ArrowLeftOnRectangle class="m-1 w-12" />
<slot>
<Tr t={Translations.t.general.loginWithOpenStreetMap} />
</slot>
</button>
{/if}