diff --git a/src/components/Modal/index.tsx b/src/components/Modal/index.tsx index 19da1e81..a75a15fa 100644 --- a/src/components/Modal/index.tsx +++ b/src/components/Modal/index.tsx @@ -1,3 +1,5 @@ +import { useEffect } from 'react'; + import DeleteFolderModal from '@domain/저장하는/components/DeleteFolderModal'; import { useModalStore } from '@stores/modal'; @@ -9,6 +11,16 @@ import MakeFolder from './modals/MakeFolder'; const Modal = () => { const { type } = useModalStore(); + useEffect(() => { + if (!type) return; + + document.body.style.overflow = 'hidden'; + + return () => { + document.body.style.overflow = 'visible'; + }; + }, [type]); + if (type === 'deleteArticle') return ; if (type === 'login') return ;