File tree Expand file tree Collapse file tree 6 files changed +61
-7
lines changed
microfrontends/SignDocuments Expand file tree Collapse file tree 6 files changed +61
-7
lines changed Original file line number Diff line number Diff line change 32
32
"react-scrollbars-custom" : " ^4.1.1" ,
33
33
"react-signature-canvas" : " ^1.0.6" ,
34
34
"reactour" : " ^1.19.1" ,
35
+ "select-dom" : " ^9.0.0" ,
35
36
"web-vitals" : " ^2.1.4"
36
37
},
37
38
"scripts" : {
Original file line number Diff line number Diff line change @@ -25,6 +25,8 @@ import Nodata from "./component/Nodata";
25
25
import Header from "./component/header" ;
26
26
import RenderPdf from "./component/renderPdf" ;
27
27
import { contractUsers , contactBook } from "../utils/Utils" ;
28
+ import { modalAlign } from "../utils/Utils" ;
29
+ import { $ } from 'select-dom' ;
28
30
//For signYourself inProgress section signer can add sign and complete doc sign.
29
31
function SignYourSelf ( ) {
30
32
const [ pdfDetails , setPdfDetails ] = useState ( [ ] ) ;
@@ -1020,7 +1022,11 @@ function SignYourSelf() {
1020
1022
>
1021
1023
{ /* this modal is used show this document is already sign */ }
1022
1024
1023
- < Modal show = { showAlreadySignDoc . status } >
1025
+ < Modal
1026
+ show = { showAlreadySignDoc . status }
1027
+ onShow = { ( ) => modalAlign ( ) }
1028
+ backdropClassName = "signature-backdrop"
1029
+ >
1024
1030
< ModalHeader style = { { background : themeColor ( ) } } >
1025
1031
< span style = { { color : "white" } } > Sign Documents</ span >
1026
1032
</ ModalHeader >
Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ import Nodata from "./component/Nodata";
27
27
import Header from "./component/header" ;
28
28
import RenderPdf from "./component/renderPdf" ;
29
29
import CustomModal from "./component/CustomModal" ;
30
+ import { modalAlign } from "../utils/Utils" ;
30
31
function EmbedPdfImage ( ) {
31
32
const { id, contactBookId } = useParams ( ) ;
32
33
const [ isSignPad , setIsSignPad ] = useState ( false ) ;
@@ -1017,7 +1018,11 @@ function EmbedPdfImage() {
1017
1018
} }
1018
1019
>
1019
1020
{ /* 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
+ >
1021
1026
< ModalHeader style = { { background : themeColor ( ) } } >
1022
1027
< span style = { { color : "white" } } > Sign Documents</ span >
1023
1028
</ ModalHeader >
Original file line number Diff line number Diff line change @@ -626,7 +626,7 @@ option {
626
626
padding : 16px ;
627
627
}
628
628
629
- /* The sticky class is added to the navbar
629
+ /* The sticky class is added to the navbar
630
630
with JS when it reaches its scroll position */
631
631
.stickyHead {
632
632
position : fixed;
@@ -644,9 +644,9 @@ option {
644
644
right : 0rem ;
645
645
}
646
646
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
650
650
page (position:fixed and top:0) */
651
651
.stickyHead + .content {
652
652
padding-top : 60px ;
@@ -776,4 +776,14 @@ option {
776
776
.mobileHead {
777
777
display : flex;
778
778
}
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 ;
779
789
}
Original file line number Diff line number Diff line change 1
1
import axios from "axios" ;
2
+ import { $ } from 'select-dom' ;
2
3
3
4
export async function getBase64FromUrl ( url ) {
4
5
const data = await fetch ( url ) ;
@@ -299,3 +300,14 @@ export const contactBook = async (objectId) => {
299
300
} ) ;
300
301
return result ;
301
302
} ;
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
+ } ;
You can’t perform that action at this time.
0 commit comments