From 1071c7165c2736286f51f3aaadfbe2f06be12b0d Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Sun, 6 Nov 2022 21:36:11 -0800 Subject: invoice and popup styles --- src/routes/(app)/invoice/[id]/+page.svelte | 100 ++++++++++++++++--------- src/routes/(app)/invoice/[id]/tip/+page.svelte | 4 +- 2 files changed, 66 insertions(+), 38 deletions(-) (limited to 'src/routes/(app)/invoice') diff --git a/src/routes/(app)/invoice/[id]/+page.svelte b/src/routes/(app)/invoice/[id]/+page.svelte index 25ebf227..47f5281b 100644 --- a/src/routes/(app)/invoice/[id]/+page.svelte +++ b/src/routes/(app)/invoice/[id]/+page.svelte @@ -3,12 +3,15 @@ import { back, copy, f, get, sat, reverseFormat, s, sats } from '$lib/utils'; import { onMount, onDestroy } from 'svelte'; import { browser } from '$app/environment'; - import { invoice as inv, invoices, last } from '$lib/store'; - import { Icon, Heart, Image, Qr } from '$comp'; + import { invoices, last } from '$lib/store'; + import { Avatar, Icon, Heart, Image, Qr } from '$comp'; import { goto } from '$app/navigation'; import { t } from '$lib/translations'; export let data; + + let showQr; + $: refresh(data); let { invoice, id, user, src } = data; let { @@ -24,8 +27,6 @@ let tipPercent = 0; let refresh = (data) => { - $inv = null; - ({ invoice, id } = data); ({ amount, @@ -63,18 +64,27 @@ -
-
-
- Scan to pay {username} +
+

+
+
Please pay
+ +
+

+ +
+ {#if !user || user.username === username || showQr} -
+
+ {/if} + +
+ {#if invoice.tip} +
+ {$t('invoice.invoice')} + + {f(amountFiat, currency)} + {`${sat(amount)}`} + +
-
- {#if invoice.tip} -
- {$t('invoice.invoice')} - - {f(amountFiat, currency)} - {`${sat(amount)}`} - -
- -
- {$t('invoice.tip')} - {f(tipAmount, currency)} - {`${sat(tip)}`} - -
- {/if} - -
- {$t('invoice.total')} +
+ {$t('invoice.tip')} {f(amountFiat + parseFloat(tipAmount), currency)} - {`${sat(tip + amount)}`} + >{f(tipAmount, currency)} + {`${sat(tip)}`} +
+ {/if} + +
+ {$t('invoice.total')} + {f(amountFiat + parseFloat(tipAmount), currency)} + {`${sat(tip + amount)}`}
+ + {#if user && user.username !== username} +
+ + + + +
+ {/if}
diff --git a/src/routes/(app)/invoice/[id]/tip/+page.svelte b/src/routes/(app)/invoice/[id]/tip/+page.svelte index ef878831..8f07fdb8 100644 --- a/src/routes/(app)/invoice/[id]/tip/+page.svelte +++ b/src/routes/(app)/invoice/[id]/tip/+page.svelte @@ -1,6 +1,6 @@