{/* Persistent signing sheet - cannot be dismissed. */}
event.preventDefault()}
onPointerDownOutside={(event) => event.preventDefault()}
onInteractOutside={(event) => event.preventDefault()}
>
Draw your signature
setSignature(value)} />
{hasSubmissionError && (
Something went wrong. Please try again.
)}
>
);
}
// Landscape: a single card, no sheet.
return (
// Need this to override the parent layout styling.
{/* The column width IS the pad width: all height left beneath the fixed
h-12 header (100svh - 2*p-2 - h-12 - mb-2 = 100svh - 4.5rem) is
converted through the pad's 16/7 aspect ratio, clamped by the
viewport width. The header is w-full of the same column, so it always
matches the pad width exactly. */}
{contextInfo.icon}
{contextInfo.title}
{contextInfo.subtitle}
setSignature(value)} />
{hasSubmissionError && (
Something went wrong. Please try again.
)}
);
};
type QrSignatureErrorReason = Exclude;
type QrSignatureErrorProps = {
reason?: QrSignatureErrorReason;
};
const QrSignatureError = ({ reason }: QrSignatureErrorProps) => {
const content = match(reason)
.with('EXPIRED', () => ({
icon: ,
title: This link has expired,
description: Generate a new QR code on the original device and scan it again.,
}))
.with('ALREADY_SUBMITTED', () => ({
icon: ,
title: Signature already sent,
description: This link has already been used. Return to your computer to continue.,
}))
.with('INVALID', () => ({
icon: ,
title: This signing request is invalid,
description: (
The request is invalid or no longer exists. Scan the new QR code on the original device to try again.
),
}))
.with(undefined, () => ({
icon: ,
title: Something went wrong,
description: We couldn't load this signing request. Please refresh the page to try again.,
}))
.exhaustive();
return (