diff --git a/src/hooks/useScrollLock.ts b/src/hooks/useScrollLock.ts index d790af5..4ff48ca 100644 --- a/src/hooks/useScrollLock.ts +++ b/src/hooks/useScrollLock.ts @@ -1,8 +1,18 @@ +/** + * Scroll Lock Hook + * Manages body scroll locking based on state and navigation transitions + */ + // hooks/useScrollLock.ts import { useEffect } from 'react'; import { useLocation } from 'react-router-dom'; import { useScrollContext } from '../components/ScrollContext'; +/** + * Custom hook to lock/unlock page scrolling + * Automatically handles scroll restoration on route changes and cleanup on unmount + * @param lock - Whether to lock the page scroll + */ export const useScrollLock = (lock: boolean) => { const location = useLocation(); const { isTransitioning, lockScroll, unlockScroll } = useScrollContext();