mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-12 21:30:34 +08:00
32 lines
664 B
Svelte
32 lines
664 B
Svelte
<script lang="typescript">
|
|
import { Connection } from "@app/session";
|
|
import { state } from '@app/session';
|
|
import type { Config } from '@app/config';
|
|
|
|
export let config: Config;
|
|
export let caption = "Connect";
|
|
export let className = "";
|
|
export let style = "";
|
|
|
|
let walletUnavailable = !window.ethereum;
|
|
|
|
$: connecting = $state.connection === Connection.Connecting;
|
|
</script>
|
|
|
|
<style>
|
|
</style>
|
|
|
|
<button
|
|
on:click={() => state.connect(config)}
|
|
{style}
|
|
class="connect {className}"
|
|
disabled={connecting || walletUnavailable}
|
|
data-waiting={connecting || null}
|
|
>
|
|
{#if connecting}
|
|
Connecting...
|
|
{:else}
|
|
{caption}
|
|
{/if}
|
|
</button>
|