From 3d733feb9db22bc956c82d2440908b2a22fd4c70 Mon Sep 17 00:00:00 2001
From: xmrcheckout
Date: Mon, 5 Jan 2026 11:17:38 +0000
Subject: [PATCH] Fix UI quirks
---
ui/app/(marketing)/docs/page.tsx | 1 -
.../btcpay-checkout-style-section.tsx | 18 +-
ui/components/invoice-panel.tsx | 219 +++++++++++++++++-
3 files changed, 220 insertions(+), 18 deletions(-)
diff --git a/ui/app/(marketing)/docs/page.tsx b/ui/app/(marketing)/docs/page.tsx
index 01ae400..56a38c6 100644
--- a/ui/app/(marketing)/docs/page.tsx
+++ b/ui/app/(marketing)/docs/page.tsx
@@ -641,7 +641,6 @@ Content-Type: application/json
Subaddress index shown on each invoice
Wallet lookahead controls discovery
Subaddresses cycle through indices 1 to 100
- Set a start index to shift the range to start + 1 through 100
Wallets may require adding the index to view funds
diff --git a/ui/components/btcpay-checkout-style-section.tsx b/ui/components/btcpay-checkout-style-section.tsx
index 32a973d..e5a0b91 100644
--- a/ui/components/btcpay-checkout-style-section.tsx
+++ b/ui/components/btcpay-checkout-style-section.tsx
@@ -2,6 +2,7 @@
import { useEffect, useState } from "react";
import { useFormState } from "react-dom";
+import { useRouter } from "next/navigation";
import {
updateBtcpayCheckoutStyleAction,
@@ -25,23 +26,30 @@ const initialState = (
export default function BtcpayCheckoutStyleSection({
initialStyle,
}: BtcpayCheckoutStyleSectionProps) {
+ const router = useRouter();
const [state, formAction] = useFormState(
updateBtcpayCheckoutStyleAction,
initialState(initialStyle)
);
- const [style, setStyle] = useState(state.style);
+ const [style, setStyle] = useState(initialStyle);
useEffect(() => {
- setStyle(state.style);
- }, [state.style]);
+ if (state.success) {
+ router.refresh();
+ }
+ }, [router, state.success]);
+
+ useEffect(() => {
+ setStyle(initialStyle);
+ }, [initialStyle]);
return (
) : (
-
-
+ <>
+
+ {activeList.map((invoice) => {
+ const isExpanded = expandedInvoiceId === invoice.id;
+ const showPaidAfterExpiry = Boolean(invoice.paid_after_expiry);
+ const isArchivable =
+ !invoice.archived_at &&
+ (invoice.status === "pending" ||
+ invoice.status === "expired" ||
+ invoice.status === "invalid");
+ return (
+
+
+
+ {invoice.archived_at ? (
+
+ Archived
+
+ ) : null}
+ {showPaidAfterExpiry ? (
+
+ Paid after expiry
+
+ ) : null}
+
+ {formatStatus(invoice.status)}
+
+
+
+
+
Amount
+
+ {formatXmrAmount(invoice.amount_xmr)} XMR
+
+
+
+
Created
+
+ {formatTimestamp(invoice.created_at)}
+
+
+
+
Expires
+
+ {formatTimestamp(invoice.expires_at)}
+
+
+
+
+
+ Open
+
+
+
+ {isExpanded ? (
+
+
+
+
Created at
+
+ {formatTimestamp(invoice.created_at)}
+
+
+
+
Detected at
+
+ {formatTimestamp(invoice.detected_at)}
+
+
+
+
Confirmed at
+
+ {formatTimestamp(invoice.confirmed_at)}
+
+
+
+
Expires at
+
+ {formatTimestamp(invoice.expires_at)}
+
+
+
+
Confirmation target
+
+ {invoice.confirmation_target}
+
+
+
+
Subaddress index
+
+ {invoice.subaddress_index ?? "-"}
+
+
+ {invoice.archived_at ? (
+
+
Archived at
+
+ {formatTimestamp(invoice.archived_at)}
+
+
+ ) : null}
+ {invoice.paid_after_expiry_at ? (
+
+
Paid after expiry at
+
+ {formatTimestamp(invoice.paid_after_expiry_at)}
+
+
+ ) : null}
+
+
+ {isArchivable ? (
+
+ ) : (
+
+ Invoice actions are unavailable for this status.
+
+ )}
+ {archiveState.error && archiveModalInvoiceId === invoice.id ? (
+
+ {archiveState.error}
+
+ ) : null}
+ {archiveState.archivedId === invoice.id ? (
+
+ Invoice archived.
+
+ ) : null}
+
+
+ ) : null}
+
+ );
+ })}
+
+
+
|
@@ -432,14 +624,16 @@ export default function InvoicePanel({
|
- |
+ |
@@ -456,22 +650,22 @@ export default function InvoicePanel({
) : null}
|
-
+ |
{formatXmrAmount(invoice.amount_xmr)} XMR
|
-
-
+ |
+
{formatStatus(invoice.status)}
|
{formatTimestamp(invoice.created_at)}
|
{formatTimestamp(invoice.expires_at)}
@@ -611,8 +805,9 @@ export default function InvoicePanel({
);
})}
- |
-
+
+
+ >
)}