Skip to content

Commit 37b7e50

Browse files
fix: when zoom in tablet widget get disappeared & hide sidbar in tablet when close
1 parent e9fab26 commit 37b7e50

File tree

6 files changed

+15
-26
lines changed

6 files changed

+15
-26
lines changed

apps/OpenSign/src/components/pdf/PlaceholderType.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ function PlaceholderType(props) {
309309
alt="signature"
310310
draggable="false"
311311
src={props.pos.SignUrl}
312-
className="w-[99%] h-full object-contain"
312+
className="w-full h-full object-contain"
313313
/>
314314
) : (
315315
<div className="text-[11px] text-black justify-center">
@@ -327,7 +327,7 @@ function PlaceholderType(props) {
327327
alt="stamp"
328328
draggable="false"
329329
src={props.pos.SignUrl}
330-
className="w-[99%] h-full object-contain"
330+
className="w-full h-full object-contain"
331331
/>
332332
) : (
333333
<div className="text-[11px] text-black justify-center">
@@ -470,7 +470,7 @@ function PlaceholderType(props) {
470470
alt="initials"
471471
draggable="false"
472472
src={props.pos.SignUrl}
473-
className="w-[99%] h-full object-contain"
473+
className="w-full h-full object-contain"
474474
/>
475475
) : (
476476
<div className="text-[11px] text-black justify-center">
@@ -650,7 +650,7 @@ function PlaceholderType(props) {
650650
alt="image"
651651
draggable="false"
652652
src={props.pos.SignUrl}
653-
className="w-[99%] h-full object-contain"
653+
className="w-full h-full object-contain"
654654
/>
655655
) : (
656656
<div className="text-[11px] text-black justify-center">
@@ -761,7 +761,7 @@ function PlaceholderType(props) {
761761
alt="image"
762762
draggable="false"
763763
src={props.pos.SignUrl}
764-
className="w-[99%] h-full object-contain"
764+
className="w-full h-full object-contain"
765765
/>
766766
</div>
767767
) : (

apps/OpenSign/src/components/pdf/RenderPdf.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,8 @@ function RenderPdf({
422422
style={{
423423
position: "relative",
424424
boxShadow: "rgba(17, 12, 46, 0.15) 0px 48px 100px 0px",
425-
height: window.innerHeight + "px"
425+
height: window.innerHeight + "px",
426+
zIndex: 0
426427
}}
427428
noScrollY={false}
428429
noScrollX={scale === 1 ? true : false}
@@ -600,7 +601,7 @@ function RenderPdf({
600601
key={index}
601602
width={containerWH.width}
602603
scale={scale || 1}
603-
className="z-0"
604+
className={"-z-[1]"} // when user zoom-in in tablet widgets move backward that's why pass -z-[1]
604605
pageNumber={pageNumber}
605606
renderAnnotationLayer={false}
606607
renderTextLayer={false}

apps/OpenSign/src/components/pdf/WidgetList.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
import React from "react";
22
import { getWidgetType } from "../../constant/Utils";
3-
import { useSelector } from "react-redux";
43

54
function WidgetList(props) {
6-
const isHeader = useSelector((state) => state.showHeader);
75
return props.updateWidgets.map((item, ind) => {
86
return (
97
<div className="2xl:p-3 mb-[5px]" key={ind}>
@@ -24,12 +22,10 @@ function WidgetList(props) {
2422
}
2523
}}
2624
onMouseMove={props?.handleDivClick}
27-
onMouseDown={() => {
28-
props?.handleMouseLeave();
29-
}}
25+
onMouseDown={() => props?.handleMouseLeave()}
3026
onTouchStart={props?.handleDivClick}
3127
>
32-
{item.ref && getWidgetType(item, isHeader)}
28+
{item.ref && getWidgetType(item)}
3329
</div>
3430
</div>
3531
);

apps/OpenSign/src/components/sidebar/Sidebar.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const Sidebar = ({ isOpen, closeSidebar }) => {
4646
};
4747
return (
4848
<aside
49-
className={`absolute md:relative bg-base-100 h-screen overflow-y-auto transition-all z-[100] hide-scrollbar
49+
className={`absolute lg:relative bg-base-100 h-screen overflow-y-auto transition-all z-[100] shadow-lg hide-scrollbar
5050
${isOpen ? "w-full md:w-[300px]" : "w-0"}`}
5151
>
5252
<div className="flex px-2 py-3 gap-2 items-center shadow-md">

apps/OpenSign/src/constant/Utils.js

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -374,25 +374,17 @@ export const addWidgetOptions = (type) => {
374374
return {};
375375
}
376376
};
377-
export const getWidgetType = (item, isHeader) => {
377+
export const getWidgetType = (item) => {
378378
return (
379379
<div className="op-btn w-fit md:w-[100%] op-btn-primary op-btn-outline op-btn-sm focus:outline-none outline outline-[1.5px] ml-[6px] md:ml-0 p-0 overflow-hidden">
380380
<div className="w-full h-full flex md:justify-between items-center">
381381
<div className="flex justify-start items-center text-[13px] ml-1">
382382
{!isMobile && <i className="fa-sharp fa-solid fa-grip-vertical"></i>}
383-
<span
384-
className={`${
385-
isHeader && "md:text-[8px] lg:text-[15px]"
386-
} md:inline-block text-center text-[15px] ml-[5px] font-semibold pr-1 md:pr-0`}
387-
>
383+
<span className="md:inline-block text-center text-[15px] ml-[5px] font-semibold pr-1 md:pr-0">
388384
{item.type}
389385
</span>
390386
</div>
391-
<div
392-
className={`${
393-
isHeader && "md:text-[8px] md:w-[20px] lg:text-[20px] lg:w-[40px] "
394-
} text-[20px] op-btn op-btn-primary rounded-none w-[40px] h-full flex justify-center items-center`}
395-
>
387+
<div className="text-[20px] op-btn op-btn-primary rounded-none w-[40px] h-full flex justify-center items-center">
396388
<i className={item.icon}></i>
397389
</div>
398390
</div>

apps/OpenSign/src/layout/HomeLayout.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ const HomeLayout = () => {
234234
}
235235

236236
const closeSidebar = () => {
237-
if (width <= 768) {
237+
if (width <= 1023) {
238238
setIsOpen(false);
239239
}
240240
};

0 commit comments

Comments
 (0)