feat: add copy buttons in receive dialog

This commit is contained in:
Danny Morabito 2025-07-07 20:47:45 +02:00
parent 18a5227033
commit 4d943c040a
Signed by: dannym
GPG key ID: 7CC8056A5A04557E
4 changed files with 11 additions and 3 deletions

View file

@ -44,8 +44,6 @@
{/if} {/if}
{/snippet} {/snippet}
</Tabs> </Tabs>
<Button onclick={closeDialog}>Confirm</Button>
</div> </div>
</dialog> </dialog>

View file

@ -1,6 +1,7 @@
<script lang="ts"> <script lang="ts">
import { getBreezSDK } from "$lib/breez.svelte"; import { getBreezSDK } from "$lib/breez.svelte";
import { getCashuAddress } from "$lib/cashu.svelte"; import { getCashuAddress } from "$lib/cashu.svelte";
import Button from "$lib/components/Button.svelte";
import QRCode from "qrcode"; import QRCode from "qrcode";
const { type, alt }: { type: string; alt: string } = $props(); const { type, alt }: { type: string; alt: string } = $props();
@ -49,6 +50,12 @@
{#await paymentText then paymentText} {#await paymentText then paymentText}
<pre class="addr">{paymentText}</pre> <pre class="addr">{paymentText}</pre>
<Button
class="copy-btn"
onclick={() => navigator.clipboard.writeText(paymentText)}
>
Copy
</Button>
{/await} {/await}
<style> <style>

View file

@ -22,7 +22,6 @@
} }
try { try {
const breezSDK = await getBreezSDK(); const breezSDK = await getBreezSDK();
console.log(breezSDK);
const parsed: InputType = await breezSDK.parse(destination); const parsed: InputType = await breezSDK.parse(destination);
if ( if (
parsed.type === "bolt11" && parsed.type === "bolt11" &&

View file

@ -102,6 +102,10 @@
}); });
</script> </script>
<svelte:head>
<title>Portal BTC</title>
</svelte:head>
{#if showInstallPrompt && deferredPrompt} {#if showInstallPrompt && deferredPrompt}
<InstallPrompt onInstall={handleInstallClick} /> <InstallPrompt onInstall={handleInstallClick} />
{:else if showSplash} {:else if showSplash}