From a865df6eb042bb305d2f880386fd6d9e5551ec4d Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Mon, 13 Mar 2023 00:44:43 -0700 Subject: payments page formatting --- .../[username]/payments/[...page]/+page.svelte | 32 +++++++++--------- src/routes/(app)/payment/[id]/+page.svelte | 39 +++++++++++++--------- 2 files changed, 40 insertions(+), 31 deletions(-) diff --git a/src/routes/(app)/[username]/payments/[...page]/+page.svelte b/src/routes/(app)/[username]/payments/[...page]/+page.svelte index a502f8c3..84891b92 100644 --- a/src/routes/(app)/[username]/payments/[...page]/+page.svelte +++ b/src/routes/(app)/[username]/payments/[...page]/+page.svelte @@ -60,9 +60,11 @@ payments = payments.map((p) => ({ ...p, created: new Date(p.created), + total: p.amount + p.tip || 0, amount_fiat: f((p.amount * p.rate) / sats, p.currency), fee_fiat: p.fee ? f((p.fee * p.rate) / sats, p.currency) : null, - tip_fiat: p.tip ? f((p.tip * p.rate) / sats, p.currency) : null + tip_fiat: p.tip ? f((p.tip * p.rate) / sats, p.currency) : null, + total_fiat: f(((p.amount + p.tip || 0) * p.rate) / sats, p.currency) })); let keys = [ @@ -72,11 +74,13 @@ 'rate', 'currency', 'amount', - 'fee', 'tip', + 'total', + 'fee', 'amount_fiat', - 'fee_fiat', - 'tip_fiat' + 'tip_fiat', + 'total_fiat', + 'fee_fiat' ]; let csv = @@ -143,24 +147,20 @@
{/if} -
Amount
{f(fiat(a, rate), currency)} - {#if tip} - - + {f(fiat(tip, rate), currency)} - - {/if} - ⚡️{`${s(a)}`} - - {#if tip} - - + ⚡️{s(tip)} - - {/if} + + ⚡️{s(a)}
+ {#if tip} +
+ Tip +
+ {f(fiat(tip, rate), currency)} + + ⚡️{s(tip)} + +
+
+ +
+ Total +
+ {f(fiat(a + tip || 0, rate), currency)} + ⚡️{`${s(a + tip || 0)}`} +
+
+ {/if} +
Network fee
{f(fiat(fee, rate), currency)} - ⚡️{`${s(fee)}`} + ⚡️{`${s(fee)}`}
-- cgit v1.2.3