mirror of
https://github.com/aljazceru/landscape-template.git
synced 2026-01-19 14:24:28 +01:00
ally: vote card
This commit is contained in:
@@ -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 (
|
||||
|
||||
Reference in New Issue
Block a user