From b720320b49df3df4924690b6beeb83753d9215b0 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Sat, 23 Dec 2023 21:58:11 -0800 Subject: liquid --- .../(app)/[username]/invoice/[id]/+page.svelte | 29 ++++++++++++++++------ 1 file changed, 21 insertions(+), 8 deletions(-) (limited to 'src/routes') diff --git a/src/routes/(app)/[username]/invoice/[id]/+page.svelte b/src/routes/(app)/[username]/invoice/[id]/+page.svelte index 0ff1c21c..9193968a 100644 --- a/src/routes/(app)/[username]/invoice/[id]/+page.svelte +++ b/src/routes/(app)/[username]/invoice/[id]/+page.svelte @@ -109,12 +109,11 @@ } }); - $: link = type === "bitcoin" ? text : `lightning:${text}`; - $: txt = type === "bitcoin" ? hash : text; + $: link = [types.bitcoin, types.liquid].includes(type) ? text : `lightning:${text}`; + $: txt = [types.bitcoin, types.liquid].includes(type) ? hash : text; - let toggleType = async () => { - invoice.type = - invoice.type === types.lightning ? types.bitcoin : types.lightning; + let setType = async (type) => { + invoice.type = type; ({ id } = await post(`/${username}/invoice`, { invoice, user: { username, currency }, @@ -130,7 +129,7 @@ class="rounded-full border py-2 px-4 font-bold hover:opacity-80 w-full" class:bg-black={type === types.lightning} class:text-white={type === types.lightning} - on:click={toggleType} + on:click={() => setType(types.lightning)} > ⚡️ Lightning @@ -139,7 +138,7 @@ class="rounded-full border py-2 px-4 font-bold hover:opacity-80 w-full flex justify-center" class:bg-black={type === types.bitcoin} class:text-white={type === types.bitcoin} - on:click={toggleType} + on:click={() => setType(types.bitcoin)} >
Bitcoin
+ + {#if showQr}
-- cgit v1.2.3