fix : minor bug fix in template

This commit is contained in:
prafull-opensignlabs
2023-12-29 23:00:37 +05:30
parent ccdf50dbe0
commit 4648ace84e
5 changed files with 227 additions and 308 deletions
@@ -83,22 +83,56 @@ function FieldsComponent({
justifyContent: "center"
}}
onClick={() => {
if (signersdata?.length) {
handleModal();
}
// if (signersdata?.length) {
handleModal();
// }
}}
>
<span style={{ fontSize: "13px", fontWeight: "700" }}>
<span
style={{
fontSize: "13px",
fontWeight: "700",
textAlign: "center"
}}
>
Recipient
</span>
<span style={{ fontSize: "13px", fontWeight: "700" }}>
<span
style={{
fontSize: "13px",
fontWeight: "700",
display: "flex",
alignItems: "center"
}}
>
{signersdata[isSelectListId]?.Role && (
<div>
{signersdata[isSelectListId]?.Name
? ` : ${signersdata[isSelectListId]?.Name}`
: ` : ${signersdata[isSelectListId]?.Role}`}
{signersdata[isSelectListId]?.Name ? (
<>
:{" "}
{signersdata[isSelectListId]?.Name?.length > 12
? `${signersdata[isSelectListId].Name.slice(
0,
12
)}...`
: signersdata[isSelectListId]?.Name}
</>
) : (
<>
:{" "}
{signersdata[isSelectListId]?.Role?.length > 12
? `${signersdata[isSelectListId].Role.slice(
0,
12
)}...`
: signersdata[isSelectListId]?.Role}
</>
)}
</div>
)}
<div style={{ marginLeft: 6, fontSize: 16 }}>
<i className="fa-solid fa-angle-down"></i>
</div>
</span>
</div>
)}
@@ -333,25 +367,41 @@ function FieldsComponent({
</div>
</div>
)}
<ModalUi
title={"Recipients"}
isOpen={isSignersModal}
handleClose={handleModal}
>
<RecipientList
signerPos={signerPos}
signersdata={signersdata}
isSelectListId={isSelectListId}
setSignerObjId={setSignerObjId}
setIsSelectId={setIsSelectId}
setContractName={setContractName}
setUniqueId={setUniqueId}
setRoleName={setRoleName}
handleDeleteUser={handleDeleteUser}
handleRoleChange={handleRoleChange}
handleOnBlur={handleOnBlur}
/>
</ModalUi>
{isSignersModal && (
<ModalUi
title={"Recipients"}
isOpen={isSignersModal}
handleClose={handleModal}
>
{signersdata.length > 0 ? (
<RecipientList
signerPos={signerPos}
signersdata={signersdata}
isSelectListId={isSelectListId}
setSignerObjId={setSignerObjId}
setIsSelectId={setIsSelectId}
setContractName={setContractName}
setUniqueId={setUniqueId}
setRoleName={setRoleName}
handleDeleteUser={handleDeleteUser}
handleRoleChange={handleRoleChange}
handleOnBlur={handleOnBlur}
handleModal={handleModal}
/>
) : (
<div
style={{
padding: 20,
fontSize: 15,
fontWeight: "500",
textAlign: "center"
}}
>
Please add Recipient
</div>
)}
</ModalUi>
)}
</>
);
}
@@ -381,14 +381,12 @@ function RenderPdf({
};
const handleUserName = (signerId, Role) => {
if (signerId) {
const checkSign = signersdata.filter(
(sign) => sign.objectId === signerId
);
if (checkSign.length > 0) {
const checkSign = signersdata.find((sign) => sign.objectId === signerId);
if (checkSign?.Name) {
return (
<>
<div style={{ color: "black", fontSize: 11 }}>
{checkSign[0].Name}
{checkSign?.Name}
</div>
<div style={{ color: "black", fontSize: 11 }}> {`(${Role})`} </div>
</>
@@ -788,7 +786,6 @@ function RenderPdf({
xyPostion,
index,
setXyPostion
);
}}
>