From 1140adfef43030e20fd63730ea8bde3f26d7b358 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Wed, 21 Feb 2024 21:37:55 -0800 Subject: invoice styles --- src/routes/(app)/[username]/(profile)/+page.svelte | 96 +++++++++------- .../(app)/[username]/invoice/[id]/+page.svelte | 126 ++++++++++++++------- .../(app)/[username]/items/create/+page.server.js | 3 - 3 files changed, 144 insertions(+), 81 deletions(-) (limited to 'src/routes/(app)') diff --git a/src/routes/(app)/[username]/(profile)/+page.svelte b/src/routes/(app)/[username]/(profile)/+page.svelte index 95dd41a4..2a0f94bb 100644 --- a/src/routes/(app)/[username]/(profile)/+page.svelte +++ b/src/routes/(app)/[username]/(profile)/+page.svelte @@ -1,5 +1,5 @@ {#if deleting} @@ -46,7 +67,7 @@
{#if user?.id === subject.id}
- +
{#if !user.balance} @@ -62,6 +83,7 @@ > -
+ {/if}
{#if i.quantity}{i.quantity}{:else}—{/if} @@ -177,30 +203,24 @@
- + {/each} {#if total > 0} -
- - - -
+
+
+ {$t("user.dashboard.checkout")} + {f(total, currency)} + + {sat(btc(total, rate), currency)} + +
+
+ {/if} diff --git a/src/routes/(app)/[username]/invoice/[id]/+page.svelte b/src/routes/(app)/[username]/invoice/[id]/+page.svelte index cd67744f..3451cf58 100644 --- a/src/routes/(app)/[username]/invoice/[id]/+page.svelte +++ b/src/routes/(app)/[username]/invoice/[id]/+page.svelte @@ -2,6 +2,7 @@ import { enhance } from "$app/forms"; import { send } from "$lib/socket"; import { + btc, post, back, copy, @@ -15,7 +16,7 @@ } from "$lib/utils"; import { tick, onMount, onDestroy } from "svelte"; import { browser } from "$app/environment"; - import { last } from "$lib/store"; + import { last, showQr } from "$lib/store"; import Avatar from "$comp/Avatar.svelte"; import Icon from "$comp/Icon.svelte"; import Heart from "$comp/Heart.svelte"; @@ -26,6 +27,7 @@ export let data; let ndef; + let showOptions; let reading = async ({ message, serialNumber }) => { let name = serialNumber.replace(/:/g, "-"); @@ -49,7 +51,6 @@ user: { username, currency }, } = invoice; - let showQr = true; let qr; let tipPercent = 0; @@ -92,6 +93,7 @@ let subbed; onMount(async () => { + $showQr = $showQr && 1 if (browser) { last.subscribe((v) => { if (!v || subbed) return; @@ -125,7 +127,7 @@
- {#if showQr} + {#if $showQr === 1}
{/if} + {#each invoice.items as i} +
+
{i.quantity} {i.name}
+
+
+ {f(i.price * i.quantity, currency)} +
+
+ {sat(btc(i.price * i.quantity, rate))} +
+
+
+ {/each} + {#if amount > 0}
@@ -167,9 +183,55 @@
{/if} -
+ + + +
+ + + + + + + + + + + + + + + + +
+ + +
- - -
- - - - - -
+ {txt} + +
+ {/if}