diff --git a/apps/web/components/editor/pdf-signer.tsx b/apps/web/components/editor/pdf-signer.tsx index b8b32c9bd..f0a672c57 100644 --- a/apps/web/components/editor/pdf-signer.tsx +++ b/apps/web/components/editor/pdf-signer.tsx @@ -30,7 +30,7 @@ export default function PDFSigner(props: any) { const signature = { fieldId: dialogField.id, type: dialogResult.type, - name: dialogResult.name, + typedSignature: dialogResult.typedSignature, signatureImage: dialogResult.signatureImage, }; @@ -72,8 +72,6 @@ export default function PDFSigner(props: any) { error: "Could not sign :/", } ); - - // goto signing done page } return ( diff --git a/apps/web/components/editor/readonly-field.tsx b/apps/web/components/editor/readonly-field.tsx index 95e241a55..34c2b75a5 100644 --- a/apps/web/components/editor/readonly-field.tsx +++ b/apps/web/components/editor/readonly-field.tsx @@ -57,7 +57,9 @@ export default function ReadOnlyField(props: FieldPropsType) { hidden={!field?.signature} className="font-qwigley text-5xl m-auto w-auto flex-row-reverse font-medium text-center" > - {field?.signature?.type === "type" ? field?.signature.name : ""} + {field?.signature?.type === "type" + ? field?.signature.typedSignature + : ""} {field?.signature?.type === "draw" ? ( ) : ( diff --git a/apps/web/components/editor/signature-dialog.tsx b/apps/web/components/editor/signature-dialog.tsx index af935870f..5cd1ed3eb 100644 --- a/apps/web/components/editor/signature-dialog.tsx +++ b/apps/web/components/editor/signature-dialog.tsx @@ -6,8 +6,9 @@ import { PencilIcon, TrashIcon, } from "@heroicons/react/24/outline"; -import { Fragment, useState } from "react"; +import { Fragment, useEffect, useState } from "react"; import SignatureCanvas from "react-signature-canvas"; +import { localStorage } from "@documenso/lib"; const tabs = [ { name: "Type", icon: LanguageIcon, current: true }, @@ -16,10 +17,13 @@ const tabs = [ export default function SignatureDialog(props: any) { const [currentTab, setCurrentTab] = useState(tabs[0]); - const [typedName, setTypedName] = useState(""); + const [typedSignature, setTypedSignature] = useState(""); const [signatureEmpty, setSignatureEmpty] = useState(true); + let signCanvasRef: any | undefined; - let signCanvas: any | undefined; + useEffect(() => { + setTypedSignature(localStorage.getItem("typedSignature") || ""); + }); return ( <> @@ -82,13 +86,16 @@ export default function SignatureDialog(props: any) { {isCurrentTab("Type") ? (
-
+
{ - setTypedName(e.target.value); + setTypedSignature(e.target.value); }} - className="font-qw leading-none h-10 align-bottom font-qwigley mt-14 text-center block border-b w-full border-gray-300 focus:border-neon focus:ring-neon text-2xl" + className={classNames( + typedSignature ? "font-qwigley text-4xl" : "", + "leading-none h-10 align-bottom mt-14 text-center block w-full focus:border-neon focus:ring-neon text-2xl" + )} placeholder="Kindly type your name" />
@@ -101,11 +108,15 @@ export default function SignatureDialog(props: any) {