Skip to content

Commit 903066e

Browse files
Merge pull request #47 from OpenSignLabs/staging
sync fork
2 parents 5c9bfbb + 8c8015f commit 903066e

File tree

6 files changed

+61
-7
lines changed

6 files changed

+61
-7
lines changed

microfrontends/SignDocuments/package-lock.json

Lines changed: 21 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

microfrontends/SignDocuments/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
"react-scrollbars-custom": "^4.1.1",
3333
"react-signature-canvas": "^1.0.6",
3434
"reactour": "^1.19.1",
35+
"select-dom": "^9.0.0",
3536
"web-vitals": "^2.1.4"
3637
},
3738
"scripts": {

microfrontends/SignDocuments/src/Component/SignYourselfPdf.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ import Nodata from "./component/Nodata";
2525
import Header from "./component/header";
2626
import RenderPdf from "./component/renderPdf";
2727
import { contractUsers, contactBook } from "../utils/Utils";
28+
import { modalAlign } from "../utils/Utils";
29+
import { $ } from 'select-dom';
2830
//For signYourself inProgress section signer can add sign and complete doc sign.
2931
function SignYourSelf() {
3032
const [pdfDetails, setPdfDetails] = useState([]);
@@ -1020,7 +1022,11 @@ function SignYourSelf() {
10201022
>
10211023
{/* this modal is used show this document is already sign */}
10221024

1023-
<Modal show={showAlreadySignDoc.status}>
1025+
<Modal
1026+
show={showAlreadySignDoc.status}
1027+
onShow={() => modalAlign()}
1028+
backdropClassName="signature-backdrop"
1029+
>
10241030
<ModalHeader style={{ background: themeColor() }}>
10251031
<span style={{ color: "white" }}> Sign Documents</span>
10261032
</ModalHeader>

microfrontends/SignDocuments/src/Component/recipientSignPdf.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import Nodata from "./component/Nodata";
2727
import Header from "./component/header";
2828
import RenderPdf from "./component/renderPdf";
2929
import CustomModal from "./component/CustomModal";
30+
import { modalAlign } from "../utils/Utils";
3031
function EmbedPdfImage() {
3132
const { id, contactBookId } = useParams();
3233
const [isSignPad, setIsSignPad] = useState(false);
@@ -1017,7 +1018,11 @@ function EmbedPdfImage() {
10171018
}}
10181019
>
10191020
{/* this modal is used show this document is already sign */}
1020-
<Modal show={isAlreadySign.status}>
1021+
<Modal
1022+
show={isAlreadySign.status}
1023+
onShow={() => modalAlign()}
1024+
backdropClassName="signature-backdrop"
1025+
>
10211026
<ModalHeader style={{ background: themeColor() }}>
10221027
<span style={{ color: "white" }}> Sign Documents</span>
10231028
</ModalHeader>

microfrontends/SignDocuments/src/css/signature.css

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,7 @@ option {
626626
padding: 16px;
627627
}
628628

629-
/* The sticky class is added to the navbar
629+
/* The sticky class is added to the navbar
630630
with JS when it reaches its scroll position */
631631
.stickyHead {
632632
position: fixed;
@@ -644,9 +644,9 @@ option {
644644
right: 0rem;
645645
}
646646

647-
/* Add some top padding to the page content
648-
to prevent sudden quick movement (as the
649-
navigation bar gets a new position at the top of the
647+
/* Add some top padding to the page content
648+
to prevent sudden quick movement (as the
649+
navigation bar gets a new position at the top of the
650650
page (position:fixed and top:0) */
651651
.stickyHead+.content {
652652
padding-top: 60px;
@@ -776,4 +776,14 @@ option {
776776
.mobileHead {
777777
display: flex;
778778
}
779+
}
780+
781+
.signature-backdrop {
782+
position: fixed;
783+
top: 0; bottom: 0; left: 0; right: 0;
784+
background-color: #000;
785+
}
786+
787+
.signature-backdrop.fade.in {
788+
opacity: 0.5;
779789
}

microfrontends/SignDocuments/src/utils/Utils.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import axios from "axios";
2+
import { $ } from 'select-dom';
23

34
export async function getBase64FromUrl(url) {
45
const data = await fetch(url);
@@ -299,3 +300,14 @@ export const contactBook = async (objectId) => {
299300
});
300301
return result;
301302
};
303+
304+
export const modalAlign = () => {
305+
let modalDialog = $('.modal-dialog').getBoundingClientRect();
306+
let mobileHead = $('.mobileHead').getBoundingClientRect()
307+
let modal = $('.modal-dialog');
308+
if (modalDialog.left < mobileHead.left) {
309+
let leftOffset = mobileHead.left - modalDialog.left;
310+
modal.style.left = leftOffset + 'px';
311+
modal.style.top = (window.innerHeight/3) + 'px';
312+
}
313+
};

0 commit comments

Comments
 (0)