Skip to content

Commit

Permalink
Merge pull request #80 from softeerbootcamp4th/fix/#79-popup-scroll
Browse files Browse the repository at this point in the history
[Fix] Popup 제출 후 스크롤 방지 삭제
  • Loading branch information
sooyeoniya authored Aug 1, 2024
2 parents 214e64c + 321c08f commit 7014d8b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions client/src/hooks/usePopup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,18 @@ export default function usePopup({
const [isVisible, setIsVisible] = useState(false);

useEffect(() => {
if (!isVisible) {
return () => {
document.body.style.overflow = "unset";
}
}, [isVisible]);
};
}, []);

const handleOpenPopup = () => {
document.body.style.overflow = "hidden";
setIsVisible(true);
};

const handleClosePopup = () => {
document.body.style.overflow = "unset";
handlePhoneNumberChange("");
setIsVisible(false);
};
Expand Down

0 comments on commit 7014d8b

Please sign in to comment.