aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/(app)/sent
diff options
context:
space:
mode:
Diffstat (limited to 'src/routes/(app)/sent')
-rw-r--r--src/routes/(app)/sent/+page.svelte26
1 files changed, 19 insertions, 7 deletions
diff --git a/src/routes/(app)/sent/+page.svelte b/src/routes/(app)/sent/+page.svelte
index 79a0aa6e..760d2e1d 100644
--- a/src/routes/(app)/sent/+page.svelte
+++ b/src/routes/(app)/sent/+page.svelte
@@ -1,5 +1,5 @@
<script>
- import { f, s, sat, sats } from '$lib/utils';
+ import { fiat, f, s, sat, sats } from '$lib/utils';
import { scale } from 'svelte/transition';
import { Icon } from '$comp';
import { toast } from '@zerodevx/svelte-toast';
@@ -7,13 +7,12 @@
export let data;
let { payments, user } = data;
+ let { currency, username } = user;
let payment = payments[0];
- let { amount, rate } = payment;
+ let { amount, rate, tip } = payment;
amount = Math.abs(amount);
- let fiat = (amount * rate) / sats;
-
toast.pop(0);
</script>
@@ -23,12 +22,25 @@
</div>
<h1 class="text-3xl md:text-4xl font-bold mb-6">Sent!</h1>
<h2 class="text-2xl md:text-3xl font-semibold">
- {f(fiat, user.currency)}
+ {f(fiat(amount, rate), currency)}
+ {#if tip}
+ <span class="text-lg">
+ + {f(fiat(tip, rate), currency)}
+ </span>
+ {/if}
</h2>
- <h3 class="text-secondary md:text-lg mb-6 mt-1">{sat(amount)}</h3>
+ <h3 class="text-secondary md:text-lg mb-6 mt-1">
+ ⚡️{s(amount)}
+
+ {#if tip}
+ <span class="text-lg">
+ + ⚡️{s(tip)}
+ </span>
+ {/if}
+ </h3>
</div>
-<a href={`/${user.username}/payments`}>
+<a href={`/${username}/payments`}>
<div class="opacity-0 w-screen h-screen fixed top-0 left-0 z-50" />
</a>