Move Open in Signer button to Bunker login actions
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
<script lang="ts">
|
||||
import {Capacitor} from "@capacitor/core"
|
||||
import Button from "@lib/components/Button.svelte"
|
||||
import Spinner from "@lib/components/Spinner.svelte"
|
||||
import QRCode from "@app/components/QRCode.svelte"
|
||||
import type {Nip46Controller} from "@app/util/nip46"
|
||||
@@ -11,11 +9,6 @@
|
||||
|
||||
const {controller}: Props = $props()
|
||||
const {url, loading} = controller
|
||||
const isIos = Capacitor.getPlatform() === "ios"
|
||||
|
||||
const openSigner = () => {
|
||||
controller.launchSigner()
|
||||
}
|
||||
</script>
|
||||
|
||||
{#if $url}
|
||||
@@ -27,11 +20,6 @@
|
||||
<div class="flex flex-col items-center gap-2">
|
||||
<QRCode code={$url} />
|
||||
<p class="text-sm opacity-75">Scan with your signer to log in, or click to copy.</p>
|
||||
{#if isIos}
|
||||
<div class="flex w-full flex-col gap-2">
|
||||
<Button class="btn btn-primary" onclick={openSigner}>Open in Signer</Button>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
{/if}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<script lang="ts">
|
||||
import {Capacitor} from "@capacitor/core"
|
||||
import {onMount, onDestroy} from "svelte"
|
||||
import type {Nip46ResponseWithResult} from "@welshman/signer"
|
||||
import {Nip46Broker} from "@welshman/signer"
|
||||
@@ -103,10 +104,16 @@
|
||||
mode = "connect"
|
||||
}
|
||||
|
||||
const openSigner = () => {
|
||||
controller.launchSigner()
|
||||
}
|
||||
|
||||
const selectBunker = () => {
|
||||
mode = "bunker"
|
||||
}
|
||||
|
||||
const isIos = Capacitor.getPlatform() === "ios"
|
||||
|
||||
let mode: string = $state("bunker")
|
||||
|
||||
$effect(() => {
|
||||
@@ -138,6 +145,9 @@
|
||||
<BunkerUrl {controller} />
|
||||
<Button class="btn {$bunker ? 'btn-neutral' : 'btn-primary'}" onclick={selectConnect}
|
||||
>Log in with a QR code instead</Button>
|
||||
{#if isIos}
|
||||
<Button class="btn btn-neutral" onclick={openSigner}>Open in Signer</Button>
|
||||
{/if}
|
||||
{/if}
|
||||
</ModalBody>
|
||||
<ModalFooter>
|
||||
|
||||
Reference in New Issue
Block a user