mirror of
https://github.com/documenso/documenso.git
synced 2025-11-14 08:42:12 +10:00
show all fields while signing, date field design
This commit is contained in:
@ -2,6 +2,7 @@ import React, { useState } from "react";
|
|||||||
import Draggable from "react-draggable";
|
import Draggable from "react-draggable";
|
||||||
import { IconButton } from "@documenso/ui";
|
import { IconButton } from "@documenso/ui";
|
||||||
import { XCircleIcon } from "@heroicons/react/20/solid";
|
import { XCircleIcon } from "@heroicons/react/20/solid";
|
||||||
|
import { classNames } from "@documenso/lib";
|
||||||
const stc = require("string-to-color");
|
const stc = require("string-to-color");
|
||||||
|
|
||||||
type FieldPropsType = {
|
type FieldPropsType = {
|
||||||
@ -43,13 +44,19 @@ export default function SignableField(props: FieldPropsType) {
|
|||||||
if (!field?.signature) props.onClick(props.field);
|
if (!field?.signature) props.onClick(props.field);
|
||||||
}}
|
}}
|
||||||
ref={nodeRef}
|
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={{
|
style={{
|
||||||
background: stc(props.field.Recipient.email),
|
background: stc(props.field.Recipient.email),
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div hidden={field?.signature} className="font-medium my-4">
|
<div hidden={field?.signature} className="font-medium my-4">
|
||||||
{field.type === "SIGNATURE" ? "SIGN HERE" : ""}
|
{field.type === "SIGNATURE" ? "SIGN HERE" : ""}
|
||||||
|
{field.type === "DATE" ? <small>Date (filled on sign)</small> : ""}
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
hidden={!field?.signature}
|
hidden={!field?.signature}
|
||||||
|
|||||||
@ -107,7 +107,6 @@ export async function getServerSideProps(context: any) {
|
|||||||
where: {
|
where: {
|
||||||
documentId: recipient.Document.id,
|
documentId: recipient.Document.id,
|
||||||
recipientId: recipient.id,
|
recipientId: recipient.id,
|
||||||
type: { in: [FieldType.SIGNATURE] },
|
|
||||||
Signature: { is: null },
|
Signature: { is: null },
|
||||||
},
|
},
|
||||||
include: {
|
include: {
|
||||||
|
|||||||
Reference in New Issue
Block a user