mirror of
https://github.com/documenso/documenso.git
synced 2025-11-10 04:22:32 +10:00
fix: firefox signing fields
This commit is contained in:
@ -6,6 +6,7 @@ import Link from 'next/link';
|
|||||||
|
|
||||||
import { Share } from 'lucide-react';
|
import { Share } from 'lucide-react';
|
||||||
|
|
||||||
|
import { useFeatureFlags } from '@documenso/lib/client-only/providers/feature-flag';
|
||||||
import { getFile } from '@documenso/lib/universal/upload/get-file';
|
import { getFile } from '@documenso/lib/universal/upload/get-file';
|
||||||
import { DocumentWithRecipient } from '@documenso/prisma/types/document-with-recipient';
|
import { DocumentWithRecipient } from '@documenso/prisma/types/document-with-recipient';
|
||||||
import DocumentDialog from '@documenso/ui/components/document/document-dialog';
|
import DocumentDialog from '@documenso/ui/components/document/document-dialog';
|
||||||
@ -29,6 +30,10 @@ export default function SinglePlayerModeSuccess({
|
|||||||
className,
|
className,
|
||||||
document,
|
document,
|
||||||
}: SinglePlayerModeSuccessProps) {
|
}: SinglePlayerModeSuccessProps) {
|
||||||
|
const { getFlag } = useFeatureFlags();
|
||||||
|
|
||||||
|
const isConfettiEnabled = getFlag('marketing_spm_confetti');
|
||||||
|
|
||||||
const [showDocumentDialog, setShowDocumentDialog] = useState(false);
|
const [showDocumentDialog, setShowDocumentDialog] = useState(false);
|
||||||
const [isFetchingDocumentFile, setIsFetchingDocumentFile] = useState(false);
|
const [isFetchingDocumentFile, setIsFetchingDocumentFile] = useState(false);
|
||||||
const [documentFile, setDocumentFile] = useState<string | null>(null);
|
const [documentFile, setDocumentFile] = useState<string | null>(null);
|
||||||
@ -66,7 +71,9 @@ export default function SinglePlayerModeSuccess({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex min-h-[calc(100vh-10rem)] flex-col items-center justify-center sm:min-h-[calc(100vh-13rem)]">
|
<div className="flex min-h-[calc(100vh-10rem)] flex-col items-center justify-center sm:min-h-[calc(100vh-13rem)]">
|
||||||
<ConfettiScreen duration={3000} gravity={0.075} initialVelocityY={50} wind={0.005} />
|
{isConfettiEnabled && (
|
||||||
|
<ConfettiScreen duration={3000} gravity={0.075} initialVelocityY={50} wind={0.005} />
|
||||||
|
)}
|
||||||
|
|
||||||
<h2 className="text-center text-2xl font-semibold leading-normal md:text-3xl lg:mb-2 lg:text-4xl">
|
<h2 className="text-center text-2xl font-semibold leading-normal md:text-3xl lg:mb-2 lg:text-4xl">
|
||||||
You have signed
|
You have signed
|
||||||
|
|||||||
@ -77,7 +77,7 @@ export const DateField = ({ field, recipient }: DateFieldProps) => {
|
|||||||
return (
|
return (
|
||||||
<SigningFieldContainer field={field} onSign={onSign} onRemove={onRemove}>
|
<SigningFieldContainer field={field} onSign={onSign} onRemove={onRemove}>
|
||||||
{isLoading && (
|
{isLoading && (
|
||||||
<div className="bg-background absolute inset-0 flex items-center justify-center">
|
<div className="bg-background absolute inset-0 flex items-center justify-center rounded-md">
|
||||||
<Loader className="text-primary h-5 w-5 animate-spin md:h-8 md:w-8" />
|
<Loader className="text-primary h-5 w-5 animate-spin md:h-8 md:w-8" />
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@ -81,7 +81,7 @@ export const EmailField = ({ field, recipient }: EmailFieldProps) => {
|
|||||||
return (
|
return (
|
||||||
<SigningFieldContainer field={field} onSign={onSign} onRemove={onRemove}>
|
<SigningFieldContainer field={field} onSign={onSign} onRemove={onRemove}>
|
||||||
{isLoading && (
|
{isLoading && (
|
||||||
<div className="bg-background absolute inset-0 flex items-center justify-center">
|
<div className="bg-background absolute inset-0 flex items-center justify-center rounded-md">
|
||||||
<Loader className="text-primary h-5 w-5 animate-spin md:h-8 md:w-8" />
|
<Loader className="text-primary h-5 w-5 animate-spin md:h-8 md:w-8" />
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@ -100,7 +100,7 @@ export const NameField = ({ field, recipient }: NameFieldProps) => {
|
|||||||
return (
|
return (
|
||||||
<SigningFieldContainer field={field} onSign={onSign} onRemove={onRemove}>
|
<SigningFieldContainer field={field} onSign={onSign} onRemove={onRemove}>
|
||||||
{isLoading && (
|
{isLoading && (
|
||||||
<div className="bg-background absolute inset-0 flex items-center justify-center">
|
<div className="bg-background absolute inset-0 flex items-center justify-center rounded-md">
|
||||||
<Loader className="text-primary h-5 w-5 animate-spin md:h-8 md:w-8" />
|
<Loader className="text-primary h-5 w-5 animate-spin md:h-8 md:w-8" />
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@ -115,7 +115,7 @@ export const SignatureField = ({ field, recipient }: SignatureFieldProps) => {
|
|||||||
return (
|
return (
|
||||||
<SigningFieldContainer field={field} onSign={onSign} onRemove={onRemove}>
|
<SigningFieldContainer field={field} onSign={onSign} onRemove={onRemove}>
|
||||||
{isLoading && (
|
{isLoading && (
|
||||||
<div className="bg-background absolute inset-0 flex items-center justify-center">
|
<div className="bg-background absolute inset-0 flex items-center justify-center rounded-md">
|
||||||
<Loader className="text-primary h-5 w-5 animate-spin md:h-8 md:w-8" />
|
<Loader className="text-primary h-5 w-5 animate-spin md:h-8 md:w-8" />
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@ -39,12 +39,16 @@ export const SigningFieldContainer = ({
|
|||||||
return (
|
return (
|
||||||
<FieldRootContainer field={field}>
|
<FieldRootContainer field={field}>
|
||||||
{!field.inserted && !loading && (
|
{!field.inserted && !loading && (
|
||||||
<button type="submit" className="absolute inset-0 z-10" onClick={onSignFieldClick} />
|
<button
|
||||||
|
type="submit"
|
||||||
|
className="absolute inset-0 z-10 h-full w-full"
|
||||||
|
onClick={onSignFieldClick}
|
||||||
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{field.inserted && !loading && (
|
{field.inserted && !loading && (
|
||||||
<button
|
<button
|
||||||
className="text-destructive bg-background/40 absolute inset-0 z-10 flex items-center justify-center rounded-md text-sm opacity-0 backdrop-blur-sm duration-200 group-hover:opacity-100"
|
className="text-destructive bg-background/40 absolute inset-0 z-10 flex h-full w-full items-center justify-center rounded-md text-sm opacity-0 backdrop-blur-sm duration-200 group-hover:opacity-100"
|
||||||
onClick={onRemoveSignedFieldClick}
|
onClick={onRemoveSignedFieldClick}
|
||||||
>
|
>
|
||||||
Remove
|
Remove
|
||||||
|
|||||||
@ -110,7 +110,7 @@ export function SinglePlayerModeSignatureField({
|
|||||||
) : (
|
) : (
|
||||||
<button
|
<button
|
||||||
onClick={() => onClick?.()}
|
onClick={() => onClick?.()}
|
||||||
className="group-hover:text-primary text-muted-foreground absolute inset-0 duration-200"
|
className="group-hover:text-primary text-muted-foreground absolute inset-0 h-full w-full duration-200"
|
||||||
>
|
>
|
||||||
Signature
|
Signature
|
||||||
</button>
|
</button>
|
||||||
@ -166,7 +166,7 @@ export function SinglePlayerModeCustomTextField({
|
|||||||
) : (
|
) : (
|
||||||
<button
|
<button
|
||||||
onClick={() => onClick?.()}
|
onClick={() => onClick?.()}
|
||||||
className="group-hover:text-primary text-muted-foreground absolute inset-0 text-lg duration-200"
|
className="group-hover:text-primary text-muted-foreground absolute inset-0 h-full w-full text-lg duration-200"
|
||||||
>
|
>
|
||||||
{match(field.type)
|
{match(field.type)
|
||||||
.with(FieldType.DATE, () => 'Date')
|
.with(FieldType.DATE, () => 'Date')
|
||||||
|
|||||||
Reference in New Issue
Block a user