From 6484736e1a69ff1d29143d0c79f6a6de3898289f Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Fri, 24 Mar 2023 21:49:32 -0700 Subject: show tip percent --- .../(app)/[username]/(profile)/+layout.svelte | 42 +++++++++------------- .../[username]/payments/[...page]/+page.svelte | 11 +++--- src/routes/(app)/payment/[id]/+page.svelte | 3 +- 3 files changed, 22 insertions(+), 34 deletions(-) (limited to 'src') diff --git a/src/routes/(app)/[username]/(profile)/+layout.svelte b/src/routes/(app)/[username]/(profile)/+layout.svelte index bbb2379e..d807e75b 100644 --- a/src/routes/(app)/[username]/(profile)/+layout.svelte +++ b/src/routes/(app)/[username]/(profile)/+layout.svelte @@ -116,6 +116,22 @@ {/if} + {#if !subject.anon && subject.username !== user?.username} +
+ + + +
+ {/if} +
- -
- - - -
- {/if} - {#if !subject.anon && subject.username !== user?.username} -
- - - -
{/if} diff --git a/src/routes/(app)/[username]/payments/[...page]/+page.svelte b/src/routes/(app)/[username]/payments/[...page]/+page.svelte index c9cc5c40..7756bd34 100644 --- a/src/routes/(app)/[username]/payments/[...page]/+page.svelte +++ b/src/routes/(app)/[username]/payments/[...page]/+page.svelte @@ -148,19 +148,16 @@
- {f((Math.abs(p.amount) + (p.tip || 0)) * (p.rate / sats), p.currency)} + {f((Math.abs(p.amount)) * (p.rate / sats), p.currency)} {#if p.tip} - - {f(Math.abs(p.amount) * (p.rate / sats), p.currency)} + {f( - p.tip * (p.rate / sats), - p.currency - )} + + +{Math.round(p.tip/Math.abs(p.amount) * 100)}% {/if}
- {sat(p.amount + (p.tip || 0))} + {sat(Math.abs(p.amount) + (p.tip || 0))}
diff --git a/src/routes/(app)/payment/[id]/+page.svelte b/src/routes/(app)/payment/[id]/+page.svelte index d3cc0b1b..8168208d 100644 --- a/src/routes/(app)/payment/[id]/+page.svelte +++ b/src/routes/(app)/payment/[id]/+page.svelte @@ -57,8 +57,9 @@ Tip
{f(fiat(tip, rate), currency)} +({Math.round((tip * 100) / Math.abs(a))}%) - ⚡️{s(tip)} + ⚡️{s(tip)}
-- cgit v1.2.3