ally: vote card

This commit is contained in:
MTG2000
2022-05-07 11:56:24 +03:00
parent dd2674a1d9
commit 7e7537bbd9
5 changed files with 28 additions and 16 deletions

View File

@@ -50,10 +50,17 @@ export default function ModalsContainer() {
}
useEffect(() => {
if (isOpen)
document.body.style.overflowY = "hidden";
else
document.body.style.overflowY = "initial";
if (isOpen) {
const scrollbarWidth = window.innerWidth - document.documentElement.clientWidth;
document.documentElement.style.overflow = 'hidden';
if (scrollbarWidth) {
document.documentElement.style.paddingRight = `${scrollbarWidth}px`;
}
}
else {
document.documentElement.style.overflow = "";
document.documentElement.style.paddingRight = "";
}
}, [isOpen]);
return (