diff --git a/apps/web/components/editor/pdf-signer.tsx b/apps/web/components/editor/pdf-signer.tsx index 3448772d6..83889f334 100644 --- a/apps/web/components/editor/pdf-signer.tsx +++ b/apps/web/components/editor/pdf-signer.tsx @@ -5,7 +5,10 @@ import dynamic from "next/dynamic"; import SignatureDialog from "./signature-dialog"; import { useEffect, useState } from "react"; import { Button } from "@documenso/ui"; -import { CheckBadgeIcon } from "@heroicons/react/24/outline"; +import { + CheckBadgeIcon, + InformationCircleIcon, +} from "@heroicons/react/24/outline"; import toast from "react-hot-toast"; import { FieldType } from "@prisma/client"; import { @@ -25,6 +28,9 @@ export default function PDFSigner(props: any) { const [signingDone, setSigningDone] = useState(false); const [localSignatures, setLocalSignatures] = useState([]); const [fields, setFields] = useState(props.fields); + const signatureFieldCount: number = fields.filter( + (field) => field.type === FieldType.SIGNATURE + ).length; const [dialogField, setDialogField] = useState(); useEffect(() => { @@ -75,46 +81,71 @@ export default function PDFSigner(props: any) {
- +
-
+

- Timur Ercan (timur.ercan31@gmail.com) would like you to sign this - document. + {props.document.User.name + ? `${props.document.User.name} (${props.document.User.email})` + : props.document.User.email}{" "} + would like you to sign this document. +

+

+

-
+ {signatureFieldCount === 0 ? ( +
+
+
+
+
+

+ You can sign this document anywhere you like, but maybe look for + a signature line. +

+
+
+
+ ) : null} field.type === FieldType.SIGNATURE) - .length === 0 - ) + if (signatureFieldCount === 0) addFreeSignature(e, page, props.recipient); }} onMouseUp={() => {}}