Skip to content

Commit

Permalink
edit: 모달 scroll lock 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
jieunpark247 committed Jul 7, 2023
1 parent 7e3a9a7 commit 56b915e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/Modal/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { HTMLAttributes } from 'react';
import cx from 'classnames';
import { type Size, modalWrapper, backgroundWrapper } from './Modal.css';
import { useClickOutside } from '@/hooks';
import { useClickOutside, useLockScroll } from '@/hooks';

type ModalProps = {
size?: Size;
Expand All @@ -11,12 +11,12 @@ type ModalProps = {
} & HTMLAttributes<HTMLDivElement>;

const Modal = ({ size, onClose, overflow, className, children, ...rest }: ModalProps) => {
useLockScroll();
const ref = useClickOutside<HTMLDivElement>({
onClickOutside: () => {
onClose();
},
});

return (
<>
<div className={cx(backgroundWrapper)} data-testid="outside"></div>
Expand Down

0 comments on commit 56b915e

Please sign in to comment.