From 614fbd99b7963ec89666b8b4252fa5f73c81653c Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Thu, 14 Nov 2024 10:55:08 -0800 Subject: amount component --- src/routes/(app)/invoice/[id]/+page.svelte | 6 ++---- src/routes/(app)/invoice/[id]/paid/+page.svelte | 21 ++++++++++++++------- 2 files changed, 16 insertions(+), 11 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 54e71071..15dc97ae 100644 --- a/src/routes/(app)/invoice/[id]/+page.svelte +++ b/src/routes/(app)/invoice/[id]/+page.svelte @@ -28,9 +28,8 @@ let { id, subject, user } = $state(data); let { invoice, src } = $derived(data); - let { hash, text } = $derived(invoice); - let { aid, amount, type, rate, tip } = $state(invoice); - let { username, currency } = invoice.user; + let { aid, amount, rate, tip, hash, text, type } = $derived(invoice); + let { username, currency } = $derived(invoice.user); let tipPercent = $derived(tip ? (tip / amount) * 100 : 0); @@ -69,7 +68,6 @@ let setAmount = $state(async () => { if (typeof $amountPrompt === "undefined") $amountPrompt = true; settingAmount = false; - amount = newAmount; invoice.amount = newAmount; invoice.tip = 0; ({ id } = await post(`/invoice`, { diff --git a/src/routes/(app)/invoice/[id]/paid/+page.svelte b/src/routes/(app)/invoice/[id]/paid/+page.svelte index 1bbba082..d6cfaa46 100644 --- a/src/routes/(app)/invoice/[id]/paid/+page.svelte +++ b/src/routes/(app)/invoice/[id]/paid/+page.svelte @@ -1,15 +1,22 @@