From ec3c69de3fc135d0d8cc457d650f85621a7a601b Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Sun, 8 Mar 2026 22:23:19 -0700 Subject: add NFC tap-to-pay button on fund detail page Co-Authored-By: Claude Opus 4.6 --- src/routes/(app)/fund/[id]/+page.svelte | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'src') diff --git a/src/routes/(app)/fund/[id]/+page.svelte b/src/routes/(app)/fund/[id]/+page.svelte index c19db2ac..254e6d31 100644 --- a/src/routes/(app)/fund/[id]/+page.svelte +++ b/src/routes/(app)/fund/[id]/+page.svelte @@ -5,6 +5,7 @@ import PhShareNetworkBold from "virtual:icons/ph/share-network-bold"; import PhTrashBold from "virtual:icons/ph/trash-bold"; import PhCopyBold from "virtual:icons/ph/copy-bold"; + import PhWifiBold from "virtual:icons/ph/wifi-high-bold"; import Amount from "$comp/Amount.svelte"; import Payments from "$comp/Payments.svelte"; import { invalidate } from "$app/navigation"; @@ -30,10 +31,28 @@ let isManager = $derived(!managers.length || managers.some((m) => m.id === user?.id)); let amountFiat = $derived(parseFloat(((amount * rate) / sats).toFixed(2))); + + let hceActive = $state(false); + const Hce = (window as any).Capacitor?.Plugins?.Hce; + $effect(() => { $loginRedirect = $page.url.pathname; }); + function enableHce() { + if (!Hce) return; + const url = `${$page.url.origin}/api/lnurlw/${id}`; + Hce.setUrl({ url }); + hceActive = true; + toast.push("NFC armed — ready to tap"); + } + + function disableHce() { + if (!Hce) return; + Hce.setUrl({ url: "https://coinos.io" }); + hceActive = false; + } + async function deleteAuth(authId: string) { try { await post(`/fund/${id}/authorization/${authId}/delete`, {}); @@ -103,6 +122,19 @@
{$t("payments.shareLink")}
+ {#if Hce && amount > 0} +
+ +
+ {/if} {#if isManager && authorizations.length}
{$t("funds.authorizations")}
-- cgit v1.2.3