From 2a59047dc8fc10560a7fde614238ee821cfb6b1b Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Thu, 26 Feb 2026 14:48:30 -0800 Subject: payment details redesign --- src/routes/(app)/payment/[id]/+page.svelte | 281 +++++++++++++++-------------- 1 file changed, 141 insertions(+), 140 deletions(-) (limited to 'src') diff --git a/src/routes/(app)/payment/[id]/+page.svelte b/src/routes/(app)/payment/[id]/+page.svelte index af729233..ca3d5b6a 100644 --- a/src/routes/(app)/payment/[id]/+page.svelte +++ b/src/routes/(app)/payment/[id]/+page.svelte @@ -16,6 +16,8 @@ import locales from "$lib/locales"; import { goto } from "$app/navigation"; + let expanded: Set = $state(new Set()); + let { data } = $props(); let user = $derived(data.user); let p = $derived(data.payment); @@ -72,16 +74,16 @@ {#snippet field(title, amount)} -
- {$t(title)} +
+ {$t(title)} + + {#if href} + + + + {/if}
+{/snippet} -
- {$t("payments.date")} -
- {format(new Date(created), "MMM d, yyyy", { locale })} {format(new Date(created), "h:mmaaa", { locale })} +
+
+

+ {$t(amount < 0 ? "payments.sent" : "payments.received")} +

+ +
+ {format(new Date(created), "MMM d, yyyy", { locale })} · {format(new Date(created), "h:mmaaa", { locale })}
- {#if type === types.ecash && amount < 0} - - Cash -
{$t("payments.ecashToken")}
-
- {:else if type === types.fund} - - - {$t( - "payments.viewFund", - )} - - {:else if memo?.includes("9734")} - {@const eid = JSON.parse(memo).tags.find((t) => t[0] === "e")[1]} - - Nostr - - {$t( - "payments.zappedEvent", - )} - - {:else if memo} -
- {$t("payments.memo")} -
- {#if memo.includes("text/plain")} - {JSON.parse(memo)[0][1]} - {:else} - {memo} - {/if} + {#if p.with} + + {direction} +
+ + {p.with.username}
-
- {/if} - - {#if type === types.lightning || type === types.bolt12} -
- {$t("payments.invoice")} -
{hash}
-
- -
- {$t("payments.preimage")} -
{ref}
-
+
{/if} - {#if type === types.ark && hash} -
- Txid -
-
{hash}
- +
+ {#if tip} + {@render field("payments.amount", a)} + {@render field("invoice.tip", tip)} + {@render field("payments.total", a + (tip || 0))} + {/if} + + {@render field("payments.networkFee", fee)} + + {#if ourfee > 0} + {@render field("payments.platformFee", ourfee)} + {/if} + +
+ {$t("payments.exchangeRate")} +
+
+ 1 + Bitcoin + = {f(rate, currency, userLocale, 0, 0)} +
- {/if} - {#if type === "bitcoin" || type === "liquid"} -
- Txid -
-
- - {txid} - + {#if type === types.ecash && amount < 0} + + {:else if type === types.fund} + + {:else if memo?.includes("9734")} + {@const eid = JSON.parse(memo).tags.find((t) => t[0] === "e")[1]} + + {:else if memo} +
+ {$t("payments.memo")} +
+ {#if memo.includes("text/plain")} + {JSON.parse(memo)[0][1]} + {:else} + {memo} + {/if}
-
-
- {/if} + {/if} - {#if path} -
- Path -
-
{path}
- -
-
- {/if} + {#if type === types.lightning || type === types.bolt12} + {@render copyable($t("payments.invoice"), hash)} + {@render copyable($t("payments.preimage"), ref)} + {/if} + + {#if type === types.ark && hash} + {@render copyable("Txid", hash)} + {/if} + + {#if type === "bitcoin" || type === "liquid"} + {@render copyable("Txid", txid, `${expl}/tx/${txid}${vout ? "#vout=" + vout : ""}`)} + {/if} + + {#if path} + {@render copyable("Path", path)} + {/if} +
-- cgit v1.2.3