From c2c201ab314e0897476e80163eda40e7307ee21a Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Fri, 29 Dec 2023 00:04:47 -0800 Subject: tweaks --- .../[username]/invoice/[id]/+layout.server.js | 5 +- .../(app)/[username]/invoice/[id]/+page.svelte | 122 +++++++++++---------- src/routes/(app)/send/invoice/[id]/+page.svelte | 2 +- static/images/lightning.svg | 67 +++++++++++ 4 files changed, 137 insertions(+), 59 deletions(-) create mode 100644 static/images/lightning.svg diff --git a/src/routes/(app)/[username]/invoice/[id]/+layout.server.js b/src/routes/(app)/[username]/invoice/[id]/+layout.server.js index 46246724..9c5f9f77 100644 --- a/src/routes/(app)/[username]/invoice/[id]/+layout.server.js +++ b/src/routes/(app)/[username]/invoice/[id]/+layout.server.js @@ -33,7 +33,6 @@ export async function load({ depends, params, url, parent }) { ); } - let sm = Qr.drawImg(invoice.text || "", { size: 380 }); - - return { id, invoice, sm, lg: sm }; + let src = Qr.drawImg(invoice.text || "", { size: 340 }); + return { id, invoice, src }; } diff --git a/src/routes/(app)/[username]/invoice/[id]/+page.svelte b/src/routes/(app)/[username]/invoice/[id]/+page.svelte index 17882e1a..c9225998 100644 --- a/src/routes/(app)/[username]/invoice/[id]/+page.svelte +++ b/src/routes/(app)/[username]/invoice/[id]/+page.svelte @@ -35,7 +35,7 @@ let readingerror = (e) => console.log("nfc error", e); $: refresh(data); - let { invoice, id, user, sm, lg } = data; + let { invoice, id, user, src } = data; let { amount, hash, @@ -50,13 +50,12 @@ } = invoice; let showQr = true; - $: src = sm; let qr; let tipPercent = 0; let refresh = async (data) => { - ({ invoice, id, user, sm, lg } = data); + ({ invoice, id, user, src } = data); ({ amount, hash, @@ -121,24 +120,26 @@ user: { username, currency }, })); - goto(`./${id}`, { invalidateAll: true }); + goto(`./${id}`, { invalidateAll: true, noScroll: true }); }; -
+
{#if showQr} - - {txt} - +
+ + {txt} + +
{/if} {#if amount > 0} @@ -154,67 +155,80 @@
{`${sat(amount)}`}⚡️{`${s(amount)}`} {#if tip} - +{sat(tip)} + +⚡️{s(tip)} {/if}
{/if} -
+ {#if type === types.liquid} +
+
+ We only support L-BTC, + don't deposit Liquid assets +
+
+ {/if} + +
- +
- -
+ + diff --git a/src/routes/(app)/send/invoice/[id]/+page.svelte b/src/routes/(app)/send/invoice/[id]/+page.svelte index c2163a81..6970d74b 100644 --- a/src/routes/(app)/send/invoice/[id]/+page.svelte +++ b/src/routes/(app)/send/invoice/[id]/+page.svelte @@ -1,4 +1,4 @@ -