aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/(app)/invoice
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2022-11-03 15:57:03 -0700
committerAdam Soltys <[email protected]>2022-11-03 15:57:03 -0700
commitbf925a332a7fde8b19f5eea677dcb0346805facd (patch)
tree1524ee617a25935b385a8f7d21865b29f0589e6a /src/routes/(app)/invoice
parentd608c466c30019c4cc7d038f2308ac0e5b204841 (diff)
downloadcoinos-ui-bf925a332a7fde8b19f5eea677dcb0346805facd.tar.gz
coinos-ui-bf925a332a7fde8b19f5eea677dcb0346805facd.zip
display tips
Diffstat (limited to 'src/routes/(app)/invoice')
-rw-r--r--src/routes/(app)/invoice/[id]/+page.svelte2
-rw-r--r--src/routes/(app)/invoice/[id]/paid/+page.svelte15
2 files changed, 13 insertions, 4 deletions
diff --git a/src/routes/(app)/invoice/[id]/+page.svelte b/src/routes/(app)/invoice/[id]/+page.svelte
index f24ca590..6de55bae 100644
--- a/src/routes/(app)/invoice/[id]/+page.svelte
+++ b/src/routes/(app)/invoice/[id]/+page.svelte
@@ -70,7 +70,7 @@
></span
>
- <Qr {src} />
+ <Qr {src} />
<div class="mb-10">
<button
diff --git a/src/routes/(app)/invoice/[id]/paid/+page.svelte b/src/routes/(app)/invoice/[id]/paid/+page.svelte
index d044a626..4f0a8ed1 100644
--- a/src/routes/(app)/invoice/[id]/paid/+page.svelte
+++ b/src/routes/(app)/invoice/[id]/paid/+page.svelte
@@ -10,11 +10,12 @@
export let data;
let { invoice } = data;
- let { amount, rate } = invoice;
+ let { amount, currency, rate, tip } = invoice;
toast.pop(0);
$: amountFiat = parseFloat(((amount * rate) / sats).toFixed(2));
+ $: tipFiat = parseFloat(((tip * rate) / sats).toFixed(2));
const handleDoneClick = () => {
delete $invoices[invoice.uuid];
@@ -28,9 +29,17 @@
</div>
<h1 class="text-3xl md:text-4xl font-bold mb-6">{$t('invoice.paymentSuccessful')}</h1>
<h2 class="text-2xl md:text-3xl font-semibold">
- {f(amountFiat, invoice.currency)}
+ {f(amountFiat, currency)}
+ {#if tip}
+ + {f(tipFiat, currency)}
+ {/if}
</h2>
- <h3 class="text-secondary md:text-lg mb-6 mt-1">{sat(invoice.amount)}</h3>
+ <h3 class="text-secondary md:text-lg mb-6 mt-1">
+ {sat(amount)}
+ {#if tip}
+ +{sat(tip)}
+ {/if}
+ </h3>
<button
class="bg-black text-white rounded-2xl w-20 py-3 font-bold hover:opacity-80"
on:click={handleDoneClick}