Remove duplicate code

This commit is contained in:
rishabjasrotia
2023-11-16 20:14:32 +05:30
parent 876a2d78d5
commit b8e8cd127a
3 changed files with 15 additions and 24 deletions
@@ -25,6 +25,7 @@ import Nodata from "./component/Nodata";
import Header from "./component/header";
import RenderPdf from "./component/renderPdf";
import { contractUsers, contactBook } from "../utils/Utils";
import { modalAlign } from "../utils/Utils";
import { $ } from 'select-dom';
//For signYourself inProgress section signer can add sign and complete doc sign.
function SignYourSelf() {
@@ -996,17 +997,6 @@ function SignYourSelf() {
});
};
const modalAlign = () => {
let modalDialog = $('.modal-dialog').getBoundingClientRect();
let mobileHead = $('.mobileHead').getBoundingClientRect()
let modal = $('.modal-dialog');
if (modalDialog.left < mobileHead.left) {
let leftOffset = mobileHead.left - modalDialog.left;
modal.style.left = leftOffset + 'px';
modal.style.top = (window.innerHeight/3) + 'px';
}
};
return (
<DndProvider backend={HTML5Backend}>
{isLoading.isLoad ? (
@@ -25,7 +25,7 @@ import Nodata from "./component/Nodata";
import Header from "./component/header";
import RenderPdf from "./component/renderPdf";
import CustomModal from "./component/CustomModal";
import { $ } from 'select-dom';
import { modalAlign } from "../utils/Utils";
function EmbedPdfImage() {
const { id, contactBookId } = useParams();
const [isSignPad, setIsSignPad] = useState(false);
@@ -954,17 +954,6 @@ function EmbedPdfImage() {
);
};
const modalAlign = () => {
let modalDialog = $('.modal-dialog').getBoundingClientRect();
let mobileHead = $('.mobileHead').getBoundingClientRect()
let modal = $('.modal-dialog');
if (modalDialog.left < mobileHead.left) {
let leftOffset = mobileHead.left - modalDialog.left;
modal.style.left = leftOffset + 'px';
modal.style.top = (window.innerHeight/3) + 'px';
}
};
return (
<DndProvider backend={HTML5Backend}>
{isLoading.isLoad ? (
@@ -1,4 +1,5 @@
import axios from "axios";
import { $ } from 'select-dom';
export async function getBase64FromUrl(url) {
const data = await fetch(url);
@@ -57,7 +58,7 @@ export function onSaveImage(xyPostion, index, signKey, imgWH, image) {
(data, ind) =>
data.key === signKey && data.Width && data.Height && data.SignUrl
);
if (updateFilter.length > 0) {
let newWidth, newHeight;
@@ -260,3 +261,14 @@ export const contactBookName = async (objectId, className) => {
});
return result;
};
export const modalAlign = () => {
let modalDialog = $('.modal-dialog').getBoundingClientRect();
let mobileHead = $('.mobileHead').getBoundingClientRect()
let modal = $('.modal-dialog');
if (modalDialog.left < mobileHead.left) {
let leftOffset = mobileHead.left - modalDialog.left;
modal.style.left = leftOffset + 'px';
modal.style.top = (window.innerHeight/3) + 'px';
}
};