From 1fec31c135772f9658d2d2061c867f14f6a15f84 Mon Sep 17 00:00:00 2001 From: secondl1ght <85003930+secondl1ght@users.noreply.github.com> Date: Wed, 31 Aug 2022 22:55:49 -0400 Subject: add copy and expand qr code buttons and mobile bug fixes --- src/routes/invoice/[id]/+page.svelte | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) (limited to 'src/routes') diff --git a/src/routes/invoice/[id]/+page.svelte b/src/routes/invoice/[id]/+page.svelte index e8bd9edf..1377c8ef 100644 --- a/src/routes/invoice/[id]/+page.svelte +++ b/src/routes/invoice/[id]/+page.svelte @@ -63,6 +63,7 @@ tipAmount = customTipAmount; tipPercent = Math.round((tipAmount / amountFiat) * 100); update(); + showMobileTip = false; }; let update = async () => { @@ -130,7 +131,7 @@ let { default: QRCodeStyling } = await import('qr-code-styling'); const qrCode = new QRCodeStyling({ - width: window.screen.width < 640 ? 250 : 300, + width: 250, type: 'canvas', data: text, image: '/images/invoice.svg', @@ -168,6 +169,16 @@ const handleDoneClick = () => { goto(`/${username}/receive`); }; + + function toggleFullscreen() { + if (!document.fullscreenElement) { + qr.requestFullscreen().catch((err) => { + alert(`Error attempting to enable fullscreen mode: ${err.message} (${err.name})`); + }); + } else { + document.exitFullscreen(); + } + } {#if $invoices[id]?.status !== 'paid'} @@ -257,7 +268,7 @@ /> -