diff --git a/frontend/src/pages/SongDetailListPage.tsx b/frontend/src/pages/SongDetailListPage.tsx index 50baef3f4..353b6055e 100644 --- a/frontend/src/pages/SongDetailListPage.tsx +++ b/frontend/src/pages/SongDetailListPage.tsx @@ -95,7 +95,12 @@ const SongDetailListPage = () => { return ( <> {onboarding && ( - + diff --git a/frontend/src/shared/components/Modal/Modal.tsx b/frontend/src/shared/components/Modal/Modal.tsx index be0ac8f62..4ac293913 100644 --- a/frontend/src/shared/components/Modal/Modal.tsx +++ b/frontend/src/shared/components/Modal/Modal.tsx @@ -9,9 +9,16 @@ interface ModalProps extends HTMLAttributes { closeModal: () => void; children: ReactElement | ReactElement[]; css?: CSSProp; + canCloseByBackDrop?: boolean; } -const Modal = ({ isOpen, closeModal, children, css }: PropsWithChildren) => { +const Modal = ({ + canCloseByBackDrop = true, + isOpen, + closeModal, + children, + css, +}: PropsWithChildren) => { const closeByEsc = useCallback( ({ key }: KeyboardEvent) => { if (key === 'Escape') { @@ -21,6 +28,12 @@ const Modal = ({ isOpen, closeModal, children, css }: PropsWithChildren { + if (!canCloseByBackDrop) return; + + closeModal(); + }; + useEffect(() => { if (isOpen) { document.body.style.overflow = 'hidden'; @@ -37,7 +50,7 @@ const Modal = ({ isOpen, closeModal, children, css }: PropsWithChildren {isOpen && ( -