From eeecc98c5b22d75b19e65cd122562e6e69eed14e Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Fri, 11 Nov 2022 20:04:48 -0800 Subject: style tweaks --- src/routes/(app)/invoice/[id]/+layout.server.js | 1 + src/routes/(app)/invoice/[id]/+page.svelte | 60 ++++++++++------------- src/routes/(app)/invoice/[id]/paid/+page.svelte | 10 ++-- src/routes/(app)/invoice/[id]/tip/+page.server.js | 6 +++ src/routes/(app)/invoice/[id]/tip/+page.svelte | 4 +- 5 files changed, 41 insertions(+), 40 deletions(-) (limited to 'src/routes/(app)/invoice') diff --git a/src/routes/(app)/invoice/[id]/+layout.server.js b/src/routes/(app)/invoice/[id]/+layout.server.js index 48d92a36..b4d7d496 100644 --- a/src/routes/(app)/invoice/[id]/+layout.server.js +++ b/src/routes/(app)/invoice/[id]/+layout.server.js @@ -8,6 +8,7 @@ export async function load({ depends, params, url }) { let { id } = params; let invoice = await get(`/invoice?uuid=${id}`); let { amount, received, pending } = invoice; + amount = parseInt(amount); let paid = (!amount && (received || pending)) || (amount > 0 && received + pending >= amount); if (paid && !url.pathname.endsWith('paid')) throw redirect(307, `/invoice/${id}/paid`); diff --git a/src/routes/(app)/invoice/[id]/+page.svelte b/src/routes/(app)/invoice/[id]/+page.svelte index 46b0f07e..50495724 100644 --- a/src/routes/(app)/invoice/[id]/+page.svelte +++ b/src/routes/(app)/invoice/[id]/+page.svelte @@ -73,11 +73,11 @@ }; - -
+

Please pay

@@ -93,25 +93,35 @@
- {#if !user || user.username === username || showQr} -
- +
+
+ +
+
- {#if address} -
{address}
- {/if} - -
- -
+ {#if address} +
{address}
{/if} +
+ + + {#if user && user.username !== username} + + + + {/if} +
+
{#if invoice.tip}
@@ -141,22 +151,6 @@
{/if}
- - {#if user && user.username !== username} -
- - - - -
- {/if}