Skip to content

Conversation

@Chiman2937
Copy link
Collaborator

✨ 작업 내용

💡 ModalProvider.jsx

현재 post/{id} 페이지에서 페이지를 삭제 한 후 삭제 완료 모달이 떠 있는 상태에서
모달 외부를 클릭하여 모달이 close 되게 만들면 list 페이지로 이동하지 않는 문제가 있습니다.

현재 modal을 사용하는 컴포넌트들에 영향을 주지 않게 만들기 위해 2번째 파라미터로 onModalClose를 전달 하도록 수정하였습니다.
따라서 기존에 작성했던 showModal 함수들은 수정하지 않아도 정상동작 합니다.
RollingPaperItemPage의 삭제완료 모달 호출하는 부분만 아래와 같이 수정하면 됩니다.
혹시 몰라서 제가 직접 수정은 안했습니다...

사용 방법

      showModal(
        <DeletePaperSuccessModal
          onClose={() => {
            closeModal();
            navigate('/list');
          }}
        />,
      ),
  const handleOnDeletePaperConfirm = async () => {
    onDeletePaperConfirm(() =>
      showModal(
        <DeletePaperSuccessModal
          onClose={() => {
            closeModal();
            navigate('/list');
          }}
        />,
// 두번째 파라미터로 `{ onModalClose: func }` 전달
        {
          onModalClose: () => {
            navigate('/list');
          },
        },
//
      ),
    );
  };

🔗 관련 이슈

Fixes #

@Chiman2937 Chiman2937 requested a review from summerDev96 June 10, 2025 08:45
@vercel
Copy link

vercel bot commented Jun 10, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
team2-rolling-app ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 10, 2025 8:45am

};

const showModal = (ModalComponent) => {
const showModal = (ModalComponent, { onModalClose } = {}) => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

onModalClose 추가된 것 확인하였습니다. 롤링 상세에 추가 후 확인해보겠습니다!

@Chiman2937 Chiman2937 merged commit ed750c6 into main Jun 10, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants