2023-04-06 01:33:08 +02:00
|
|
|
<script lang="ts">
|
2023-06-14 20:39:36 +02:00
|
|
|
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"
|
2023-04-06 01:33:08 +02:00
|
|
|
|
2023-06-14 20:39:36 +02:00
|
|
|
export let osmConnection: OsmConnection
|
2023-06-15 05:38:52 +02:00
|
|
|
export let clss: string | undefined = undefined
|
2024-05-21 01:49:52 +02:00
|
|
|
|
2024-06-16 16:06:26 +02:00
|
|
|
if (osmConnection === undefined) {
|
2024-05-21 01:49:52 +02:00
|
|
|
console.error("No osmConnection passed into loginButton")
|
|
|
|
}
|
2025-01-27 04:50:44 +01:00
|
|
|
let isLoggedIn = osmConnection.isLoggedIn
|
2023-04-06 01:33:08 +02:00
|
|
|
</script>
|
|
|
|
|
2025-01-27 04:50:44 +01:00
|
|
|
{#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}
|