From 28edb9a193263697fce8bba0fbad9165f762c534 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Tue, 8 Nov 2022 13:37:53 -0800 Subject: qr styles --- .../[username]/receive/[...recipient]/+page.svelte | 3 +++ src/routes/(app)/invoice/[id]/+page.svelte | 31 +++++++++++++++++++--- src/routes/(app)/invoice/[id]/tip/+page.svelte | 6 ++++- 3 files changed, 36 insertions(+), 4 deletions(-) (limited to 'src/routes/(app)') diff --git a/src/routes/(app)/[username]/receive/[...recipient]/+page.svelte b/src/routes/(app)/[username]/receive/[...recipient]/+page.svelte index 19e307e4..7f2cf666 100644 --- a/src/routes/(app)/[username]/receive/[...recipient]/+page.svelte +++ b/src/routes/(app)/[username]/receive/[...recipient]/+page.svelte @@ -27,6 +27,8 @@ $: paid = browser && form && Object.values($invoices).find((inv) => inv.amount === form.amount); $: paid && goto(`/invoice/${paid.uuid}/paid`); + + let network = 'lightning'; {#if form && req} @@ -54,6 +56,7 @@ + {#if req} diff --git a/src/routes/(app)/invoice/[id]/+page.svelte b/src/routes/(app)/invoice/[id]/+page.svelte index f8ae91f1..cf87d39b 100644 --- a/src/routes/(app)/invoice/[id]/+page.svelte +++ b/src/routes/(app)/invoice/[id]/+page.svelte @@ -7,6 +7,7 @@ import { Avatar, Icon, Heart, Image, Qr } from '$comp'; import { goto } from '$app/navigation'; import { t } from '$lib/translations'; + import screenfull from 'screenfull'; export let data; @@ -15,7 +16,9 @@ $: refresh(data); let { invoice, id, user, src } = data; let { + address, amount, + network, rate, received, prompt, @@ -24,12 +27,15 @@ user: { username, currency } } = invoice; + let qr; let tipPercent = 0; let refresh = (data) => { ({ invoice, id } = data); ({ + address, amount, + network, rate, received, prompt, @@ -58,6 +64,13 @@ send('subscribe', invoice); }); }); + + $: link = address ? text : `lightning:${text}`; + + let click = () => { + if (screenfull.isFullscreen) screenfull.toggle(qr); + else window.location.href = link; + }; + {/if} @@ -141,6 +162,10 @@