Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion components/composed/TicketDownloadCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,21 @@ type TicketDownloadCardProps = {

const DEFAULT_BRAND_COLOR = "#6366f1"

/**
* Extracts just the host from the recovery URL (e.g. "waitlight.fr"), so the
* hint text always names whatever domain the QR code actually points to —
* previously this was a hardcoded string that stayed "waitlight.app" even
* when recoverUrl pointed somewhere else entirely (a Preview deployment, a
* different environment), which is misleading on a real, physical ticket.
*/
function hostFromUrl(url: string): string {
try {
return new URL(url).host
} catch {
return ""
}
}

/**
* The visual captured to PNG when a customer downloads their ticket. Pure
* presentation — no state, no network calls — so it renders identically
Expand Down Expand Up @@ -124,7 +139,7 @@ const TicketDownloadCard = forwardRef<HTMLDivElement, TicketDownloadCardProps>(
{recoveryCode}
</span>
<span className="text-[11px] text-text-secondary">
Prénom + code sur waitlight.app
Prénom + code sur {hostFromUrl(recoverUrl)}
</span>
</div>
{/* SVG, not Canvas: html-to-image serializes the DOM/SVG
Expand Down
Loading