This commit is contained in:
Timur Ercan
2023-04-04 17:46:23 +02:00
parent 2291744580
commit 2d0fb2879d

View File

@ -50,16 +50,16 @@ export default function PDFEditor(props: any) {
return ( return (
<> <>
<div> <div>
<div className="rounded-md bg-blue-50 p-4"> <div hidden={!noRecipients} className="rounded-md bg-yellow-50 p-4">
<div className="flex"> <div className="flex">
<div className="flex-shrink-0"> <div className="flex-shrink-0">
<InformationCircleIcon <InformationCircleIcon
className="h-5 w-5 text-blue-400" className="h-5 w-5 text-yellow-400"
aria-hidden="true" aria-hidden="true"
/> />
</div> </div>
<div className="ml-3 flex-1 md:flex md:justify-between"> <div className="ml-3 flex-1 md:flex md:justify-between">
<p className="text-sm text-blue-700"> <p className="text-sm text-yellow-700">
This document does not have any recipients. Add recipients to This document does not have any recipients. Add recipients to
create fields. create fields.
</p> </p>
@ -71,7 +71,7 @@ export default function PDFEditor(props: any) {
props.document.id + props.document.id +
"/recipients" "/recipients"
} }
className="whitespace-nowrap font-medium text-blue-700 hover:text-blue-600" className="whitespace-nowrap font-medium text-yellow-700 hover:text-yellow-600"
> >
Add Recipients Add Recipients
<span aria-hidden="true"> &rarr;</span> <span aria-hidden="true"> &rarr;</span>
@ -82,7 +82,9 @@ export default function PDFEditor(props: any) {
</div> </div>
<PDFViewer <PDFViewer
style={{ style={{
cursor: `url("https://place-hold.it/110x64/37f095/FFFFFF&text=${selectedFieldType}") 55 32, auto`, cursor: !noRecipients
? `url("https://place-hold.it/110x64/37f095/FFFFFF&text=${selectedFieldType}") 55 32, auto`
: "",
}} }}
readonly={false} readonly={false}
document={props.document} document={props.document}
@ -119,6 +121,7 @@ export default function PDFEditor(props: any) {
function addField(e: any, page: number) { function addField(e: any, page: number) {
if (!selectedRecipient) return; if (!selectedRecipient) return;
if (!selectedFieldType) return; if (!selectedFieldType) return;
if (noRecipients) return;
const signatureField = createField( const signatureField = createField(
e, e,