Update prettier styling

This commit is contained in:
Ephraim Atta-Duncan
2023-04-04 22:10:30 +00:00
parent 84b57d715c
commit 964e749039
34 changed files with 258 additions and 93 deletions

View File

@ -92,9 +92,15 @@ export default function PDFEditor(props: any) {
<div
hidden={noRecipients}
className="fixed left-0 top-1/3 max-w-xs rounded-md border border-slate-300 bg-white py-4 pr-5">
<RecipientSelector recipients={props?.document?.Recipient} onChange={setSelectedRecipient} />
<RecipientSelector
recipients={props?.document?.Recipient}
onChange={setSelectedRecipient}
/>
<hr className="m-3 border-slate-300"></hr>
<FieldTypeSelector selectedRecipient={selectedRecipient} onChange={setSelectedFieldType} />
<FieldTypeSelector
selectedRecipient={selectedRecipient}
onChange={setSelectedFieldType}
/>
</div>
</div>
</>

View File

@ -87,9 +87,13 @@ export default function PDFSigner(props: any) {
icon={CheckBadgeIcon}
className="float-right"
onClick={() => {
signDocument(props.document, localSignatures, `${router.query.token}`).then(() => {
router.push(`/documents/${props.document.id}/signed?token=${router.query.token}`);
});
signDocument(props.document, localSignatures, `${router.query.token}`).then(
() => {
router.push(
`/documents/${props.document.id}/signed?token=${router.query.token}`
);
}
);
}}>
Done
</Button>
@ -135,7 +139,9 @@ export default function PDFSigner(props: any) {
// Check if all fields are signed..
if (signatureFields.length > 0) {
// If there are no fields to sign at least one signature is enough
return fields.filter((field) => field.type === FieldType.SIGNATURE).every((field) => field.signature);
return fields
.filter((field) => field.type === FieldType.SIGNATURE)
.every((field) => field.signature);
} else {
return localSignatures.length > 0;
}

View File

@ -30,7 +30,10 @@ export default function PDFViewer(props) {
return (
<>
<div hidden={loading} onMouseUp={props.onMouseUp} style={{ height: numPages * pageHeight + 1000 }}>
<div
hidden={loading}
onMouseUp={props.onMouseUp}
style={{ height: numPages * pageHeight + 1000 }}>
<div className="mt-6 max-w-xs"></div>
<Document
file={props.pdfUrl}
@ -76,7 +79,11 @@ export default function PDFViewer(props) {
onDelete={onDeleteHandler}></SignableField>
) : (
<EditableField
hidden={field.Signature || field.inserted || field.type === FieldType.FREE_SIGNATURE}
hidden={
field.Signature ||
field.inserted ||
field.type === FieldType.FREE_SIGNATURE
}
key={field.id}
field={field}
className="absolute"

View File

@ -71,7 +71,9 @@ export default function SignatureDialog(props: any) {
aria-current={tab.current ? "page" : undefined}>
<tab.icon
className={classNames(
tab.current ? "text-neon" : "text-gray-400 group-hover:text-gray-500",
tab.current
? "text-neon"
: "text-gray-400 group-hover:text-gray-500",
"-ml-0.5 mr-2 h-5 w-5"
)}
aria-hidden="true"