From 49461a43bb9918c164bbaee0f8d9542de46d9ba0 Mon Sep 17 00:00:00 2001 From: RaktimaNXG Date: Wed, 4 Sep 2024 19:39:10 +0530 Subject: [PATCH 1/3] fix: drop widgets in center of document in mobile view --- apps/OpenSign/src/components/pdf/RenderPdf.js | 3 ++- apps/OpenSign/src/pages/PlaceHolderSign.js | 10 ++++------ apps/OpenSign/src/pages/SignyourselfPdf.js | 20 +++++++++---------- .../OpenSign/src/pages/TemplatePlaceholder.js | 10 ++++------ 4 files changed, 20 insertions(+), 23 deletions(-) diff --git a/apps/OpenSign/src/components/pdf/RenderPdf.js b/apps/OpenSign/src/components/pdf/RenderPdf.js index ef8576862..f0a967c2d 100644 --- a/apps/OpenSign/src/components/pdf/RenderPdf.js +++ b/apps/OpenSign/src/components/pdf/RenderPdf.js @@ -364,7 +364,8 @@ function RenderPdf({ ); }) - : xyPostion.map((data, ind) => { + : !pdfDetails?.[0]?.IsCompleted && + xyPostion.map((data, ind) => { return ( {data.pageNumber === pageNumber && diff --git a/apps/OpenSign/src/pages/PlaceHolderSign.js b/apps/OpenSign/src/pages/PlaceHolderSign.js index 3072cf467..617bcc64f 100644 --- a/apps/OpenSign/src/pages/PlaceHolderSign.js +++ b/apps/OpenSign/src/pages/PlaceHolderSign.js @@ -479,14 +479,12 @@ function PlaceHolderSign() { const widgetHeight = defaultWidthHeight(dragTypeValue).height; //adding and updating drop position in array when user drop signature button in div if (item === "onclick") { + const divHeight = divRef.current.getBoundingClientRect().height; + // `getBoundingClientRect()` is used to get accurate measurement height of the div const dropObj = { //onclick put placeholder center on pdf - xPosition: - (containerWH.width / 2 - widgetWidth / 2) / - (containerScale * scale), - yPosition: - (containerWH.height / 2 - widgetHeight / 2) / - (containerScale * scale), + xPosition: widgetWidth / 4 + containerWH.width / 2, + yPosition: widgetHeight + divHeight / 2, isStamp: (dragTypeValue === "stamp" || dragTypeValue === "image") && true, key: key, diff --git a/apps/OpenSign/src/pages/SignyourselfPdf.js b/apps/OpenSign/src/pages/SignyourselfPdf.js index da31e5214..94ca515c9 100644 --- a/apps/OpenSign/src/pages/SignyourselfPdf.js +++ b/apps/OpenSign/src/pages/SignyourselfPdf.js @@ -415,28 +415,28 @@ function SignYourSelf() { pageNumber, containerWH ); + console.log("container", widgetTypeExist, dragTypeValue, widgetValue); //adding and updating drop position in array when user drop signature button in div if (item === "onclick") { + // `getBoundingClientRect()` is used to get accurate measurement height of the div + const divHeight = divRef.current.getBoundingClientRect().height; const getWidth = widgetTypeExist ? calculateInitialWidthHeight(dragTypeValue, widgetValue).getWidth - : dragTypeValue === "initials" - ? defaultWidthHeight(dragTypeValue).width - : ""; + : defaultWidthHeight(dragTypeValue).width; const getHeight = widgetTypeExist ? calculateInitialWidthHeight(dragTypeValue, widgetValue).getHeight - : dragTypeValue === "initials" - ? defaultWidthHeight(dragTypeValue).height - : ""; + : defaultWidthHeight(dragTypeValue).height; + dropObj = { - xPosition: containerWH.width / 2, - yPosition: containerWH.height / 2, + xPosition: getWidth / 2 + containerWH.width / 2, + yPosition: getHeight + divHeight / 2, isStamp: (dragTypeValue === "stamp" || dragTypeValue === "image") && true, key: key, type: dragTypeValue, scale: containerScale, - Width: getWidth / (containerScale * scale), - Height: getHeight / (containerScale * scale), + Width: getWidth, + Height: getHeight, options: addWidgetOptions(dragTypeValue) }; dropData.push(dropObj); diff --git a/apps/OpenSign/src/pages/TemplatePlaceholder.js b/apps/OpenSign/src/pages/TemplatePlaceholder.js index bdff205f6..96cacac81 100644 --- a/apps/OpenSign/src/pages/TemplatePlaceholder.js +++ b/apps/OpenSign/src/pages/TemplatePlaceholder.js @@ -384,14 +384,12 @@ const TemplatePlaceholder = () => { currentPagePosition; let placeHolder; if (item === "onclick") { + // `getBoundingClientRect()` is used to get accurate measurement height of the div + const divHeight = divRef.current.getBoundingClientRect().height; const dropObj = { //onclick put placeholder center on pdf - xPosition: - (containerWH.width / 2 - widgetWidth / 2) / - (containerScale * scale), - yPosition: - (containerWH.height / 2 - widgetHeight / 2) / - (containerScale * scale), + xPosition: widgetWidth / 4 + containerWH.width / 2, + yPosition: widgetHeight + divHeight / 2, isStamp: (dragTypeValue === "stamp" || dragTypeValue === "image") && true, key: key, From 6da22d23a881fda80a4beb30593f63a637e61b83 Mon Sep 17 00:00:00 2001 From: RaktimaNXG Date: Wed, 4 Sep 2024 19:41:39 +0530 Subject: [PATCH 2/3] fix: remove console --- apps/OpenSign/src/pages/SignyourselfPdf.js | 1 - 1 file changed, 1 deletion(-) diff --git a/apps/OpenSign/src/pages/SignyourselfPdf.js b/apps/OpenSign/src/pages/SignyourselfPdf.js index 94ca515c9..7b8da5a2d 100644 --- a/apps/OpenSign/src/pages/SignyourselfPdf.js +++ b/apps/OpenSign/src/pages/SignyourselfPdf.js @@ -415,7 +415,6 @@ function SignYourSelf() { pageNumber, containerWH ); - console.log("container", widgetTypeExist, dragTypeValue, widgetValue); //adding and updating drop position in array when user drop signature button in div if (item === "onclick") { // `getBoundingClientRect()` is used to get accurate measurement height of the div From f3de883e39ff1a0726251908b20c808c2ebe8f34 Mon Sep 17 00:00:00 2001 From: RaktimaNXG Date: Thu, 5 Sep 2024 09:59:07 +0530 Subject: [PATCH 3/3] fix: increase close button size of react tour in mobile view --- apps/OpenSign/src/index.css | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/apps/OpenSign/src/index.css b/apps/OpenSign/src/index.css index a3fe178d4..3aa22814d 100644 --- a/apps/OpenSign/src/index.css +++ b/apps/OpenSign/src/index.css @@ -12,23 +12,35 @@ body { } .hide-scrollbar { - -ms-overflow-style: none; /* IE and Edge */ - scrollbar-width: none; /* Firefox */ + -ms-overflow-style: none; + /* IE and Edge */ + scrollbar-width: none; + /* Firefox */ +} + +@media screen and (max-width: 766px) { + .bBofGr { + width: 14px !important; + } } /* below css class replace bootstrap background color with daisy */ .op-bg-primary { @apply bg-primary; } + .op-bg-secondary { @apply bg-secondary; } + .op-bg-info { @apply bg-info; } + .op-bg-success { @apply bg-success; } + .op-bg-warning { @apply bg-warning; } @@ -37,28 +49,37 @@ body { .op-text-primary { @apply text-primary; } + .op-text-secondary { @apply text-secondary; } + .op-text-info { @apply text-info; } + .op-text-accent { @apply text-accent; } + .op-text-success { @apply text-success; } + .op-text-warning { @apply text-warning; } + .op-border-primary { @apply border-primary; } + /* CSS for scrollbar customization */ * { - scrollbar-width: thin; /* For Firefox */ - scrollbar-color: gray; /* For Firefox */ + scrollbar-width: thin; + /* For Firefox */ + scrollbar-color: gray; + /* For Firefox */ } /* For webkit-based browsers like Chrome, Safari */ @@ -73,4 +94,4 @@ body { *::-webkit-scrollbar-thumb { background-color: gray; border-radius: 10px; -} +} \ No newline at end of file