From c711a4ac10e4c9e842811926375c20b607d7164d Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Tue, 6 Jun 2023 13:31:18 -0700 Subject: buttons on invoice page --- src/locales/en.json | 3 + .../(app)/[username]/invoice/[hash]/+page.svelte | 68 ++++++++++++++++------ 2 files changed, 53 insertions(+), 18 deletions(-) (limited to 'src') diff --git a/src/locales/en.json b/src/locales/en.json index 8176ae4c..0a00e7f8 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -239,7 +239,10 @@ "takeFunds": "Take Funds", "show": "Show", "hide": "Hide", + "qr": "QR", "copyLink": "Copy Link", + "copyText": "Copy Text", + "openLink": "Open Link", "total": "Total", "gainLoss": "Gain/Loss", "presentValue": "Present Value", diff --git a/src/routes/(app)/[username]/invoice/[hash]/+page.svelte b/src/routes/(app)/[username]/invoice/[hash]/+page.svelte index 68783112..dbf36694 100644 --- a/src/routes/(app)/[username]/invoice/[hash]/+page.svelte +++ b/src/routes/(app)/[username]/invoice/[hash]/+page.svelte @@ -35,7 +35,7 @@ user: { username, currency } } = invoice; - let showQr = !amount; + let showQr = invoice.uid === user.id; $: src = sm; @@ -58,14 +58,14 @@ tipPercent = (tip / amount) * 100; - // if (browser && window.NDEFReader) { + // if (browser && window.NDEFReader) { // try { // ndef = new NDEFReader(); // await ndef.scan(); - // + // // ndef.removeEventListener('readingerror', readingerror); // ndef.removeEventListener('reading', reading); - // + // // ndef.addEventListener('readingerror', readingerror); // ndef.addEventListener('reading', reading); // } catch (e) { @@ -110,7 +110,7 @@ }; -
+
-
- -
-
- {txt} + {#if showQr} + + {/if} {#if amount > 0}
@@ -172,10 +179,35 @@
{/if} -
+ + +
{$t('payments.copyText')}
+ + + + +
-- cgit v1.2.3