From f29464d9300b51210191ba56e33f6f6b64df3497 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Thu, 28 Dec 2023 22:45:59 -0800 Subject: liquid --- .../[username]/invoice/[id]/+layout.server.js | 2 +- .../(app)/[username]/invoice/[id]/+page.svelte | 109 ++++++++++----------- .../[username]/invoice/[id]/paid/+page.svelte | 17 +++- .../[username]/payments/[...page]/+page.svelte | 8 ++ .../[username]/receive/[...param]/+page.svelte | 2 +- src/routes/(app)/payment/[id]/+page.svelte | 5 +- 6 files changed, 77 insertions(+), 66 deletions(-) (limited to 'src') diff --git a/src/routes/(app)/[username]/invoice/[id]/+layout.server.js b/src/routes/(app)/[username]/invoice/[id]/+layout.server.js index c69da78a..46246724 100644 --- a/src/routes/(app)/[username]/invoice/[id]/+layout.server.js +++ b/src/routes/(app)/[username]/invoice/[id]/+layout.server.js @@ -33,7 +33,7 @@ export async function load({ depends, params, url, parent }) { ); } - let sm = Qr.drawImg(invoice.text || "", { size: 300 }); + let sm = Qr.drawImg(invoice.text || "", { size: 380 }); return { id, invoice, sm, lg: sm }; } diff --git a/src/routes/(app)/[username]/invoice/[id]/+page.svelte b/src/routes/(app)/[username]/invoice/[id]/+page.svelte index 9193968a..709f214b 100644 --- a/src/routes/(app)/[username]/invoice/[id]/+page.svelte +++ b/src/routes/(app)/[username]/invoice/[id]/+page.svelte @@ -123,17 +123,49 @@ }; -
-
- +
+ {#if showQr} + + {txt} + + {/if} + + + {#if amount > 0} +
+
+ {f(amountFiat, currency)} + {#if tip} + + +{f(tip * (rate / sats), currency)} + + {/if} +
+
+ {`${sat(amount)}`} + + {#if tip} + + +{sat(tip)} + + {/if} +
+
+ {/if} + +
-
- - {#if showQr} -
- - - {/if} - {#if amount > 0} -
-
- {f(amountFiat, currency)} - - {#if tip} - - +{f(tip * (rate / sats), currency)} - - {/if} -
-
- {`${sat(amount)}`} + - {#if tip} - - +{sat(tip)} - - {/if} -
-
- {/if} +
diff --git a/src/routes/(app)/[username]/invoice/[id]/paid/+page.svelte b/src/routes/(app)/[username]/invoice/[id]/paid/+page.svelte index 9740dc92..ee00214c 100644 --- a/src/routes/(app)/[username]/invoice/[id]/paid/+page.svelte +++ b/src/routes/(app)/[username]/invoice/[id]/paid/+page.svelte @@ -8,21 +8,25 @@ export let data; let amount, currency, rate, received, pending, tip, user, id; - $: data && + $: update(data) + let update = (data) => { ({ amount, currency, rate, received, pending, tip, user, id } = data.invoice); + } toast.pop(0);
-
- -
{#if received} +
+ +
+

{$t("invoice.paymentSuccessful")}

+

{f(fiat(received - tip, rate), currency)} {#if tip} @@ -43,6 +47,10 @@ {/if} {#if pending} +
+ +
+

Payment detected

{f(fiat(pending - tip, rate), currency)} @@ -50,6 +58,7 @@ + {f(fiat(tip, rate), currency)} {/if}

+

⚡️{s(pending - tip)} {#if tip} diff --git a/src/routes/(app)/[username]/payments/[...page]/+page.svelte b/src/routes/(app)/[username]/payments/[...page]/+page.svelte index 1f20ea5c..3237011b 100644 --- a/src/routes/(app)/[username]/payments/[...page]/+page.svelte +++ b/src/routes/(app)/[username]/payments/[...page]/+page.svelte @@ -220,6 +220,14 @@ alt="Bitcoin" />

+ {:else if p.type === types.liquid} +
+ Liquid +
{/if}
diff --git a/src/routes/(app)/[username]/receive/[...param]/+page.svelte b/src/routes/(app)/[username]/receive/[...param]/+page.svelte index 6d8939a9..7a27bd67 100644 --- a/src/routes/(app)/[username]/receive/[...param]/+page.svelte +++ b/src/routes/(app)/[username]/receive/[...param]/+page.svelte @@ -28,7 +28,7 @@
diff --git a/src/routes/(app)/payment/[id]/+page.svelte b/src/routes/(app)/payment/[id]/+page.svelte index 15c17a00..49af6f70 100644 --- a/src/routes/(app)/payment/[id]/+page.svelte +++ b/src/routes/(app)/payment/[id]/+page.svelte @@ -136,7 +136,7 @@
- {#if type === "bitcoin"} + {#if type === "bitcoin" || type === "liquid"}
Txid
@@ -146,7 +146,8 @@
-- cgit v1.2.3