Skip to content

The Open Source DocuSign Alternative.

show all fields while signing, date field design

Timur Ercan253e5cfcfaf8
diff --git a/apps/web/components/editor/signable-field.tsx b/apps/web/components/editor/signable-field.tsx
index cde6b8eb3..aa0ae07e9 100644
--- a/apps/web/components/editor/signable-field.tsx
+++ b/apps/web/components/editor/signable-field.tsx
@@ -2,6 +2,7 @@ import React, { useState } from "react";
import Draggable from "react-draggable";
import { IconButton } from "@documenso/ui";
import { XCircleIcon } from "@heroicons/react/20/solid";
+import { classNames } from "@documenso/lib";
const stc = require("string-to-color");
type FieldPropsType = {
@@ -43,13 +44,19 @@ export default function SignableField(props: FieldPropsType) {
if (!field?.signature) props.onClick(props.field);
}}
ref={nodeRef}
- className="cursor-pointer opacity-80 m-auto w-48 h-16 flex-row-reverse text-lg font-bold text-center absolute top-0 left-0 select-none hover:brightness-50"
+ className={classNames(
+ "opacity-80 m-auto w-48 h-16 flex-row-reverse text-lg font-bold text-center absolute top-0 left-0 select-none",
+ field.type === "SIGNATURE"
+ ? "cursor-pointer hover:brightness-50"
+ : "cursor-not-allowed"
+ )}
style={{
background: stc(props.field.Recipient.email),
}}
>
<div hidden={field?.signature} className="font-medium my-4">
{field.type === "SIGNATURE" ? "SIGN HERE" : ""}
+ {field.type === "DATE" ? <small>Date (filled on sign)</small> : ""}
</div>
<div
hidden={!field?.signature}
diff --git a/apps/web/pages/documents/[id]/sign.tsx b/apps/web/pages/documents/[id]/sign.tsx
index 37d6ad7c8..e46c35c8f 100644
--- a/apps/web/pages/documents/[id]/sign.tsx
+++ b/apps/web/pages/documents/[id]/sign.tsx
@@ -107,7 +107,6 @@ export async function getServerSideProps(context: any) {
where: {
documentId: recipient.Document.id,
recipientId: recipient.id,
- type: { in: [FieldType.SIGNATURE] },
Signature: { is: null },
},
include: {