Fix modal scrolling

This commit is contained in:
Joey Yakimowich-Payne 2026-01-13 23:56:21 -07:00
commit 683cd039e7
No known key found for this signature in database
GPG key ID: 6BFE655FA5ABD1E1
6 changed files with 27 additions and 0 deletions

View file

@ -0,0 +1,12 @@
import { useEffect } from 'react';
export const useBodyScrollLock = (isLocked: boolean) => {
useEffect(() => {
if (isLocked) {
document.body.style.overflow = 'hidden';
}
return () => {
document.body.style.overflow = '';
};
}, [isLocked]);
};