fix: handle error for small screen in debug pdf page

This commit is contained in:
prafull-opensignlabs
2024-02-07 12:08:27 +05:30
parent da846dcbbb
commit db9ec6bfd5
2 changed files with 230 additions and 217 deletions
@@ -0,0 +1,25 @@
import { useEffect, useState } from "react";
export function useWindowSize() {
const [size, setSize] = useState({
width: 0,
height: 0
});
const onResize = () => {
setSize({
width: window.innerWidth,
height: window.innerHeight
});
};
useEffect(() => {
onResize();
window.addEventListener("resize", onResize);
return () => {
window.removeEventListener("resize", onResize);
};
}, []);
return size;
}