Skip to content

Commit

Permalink
Merge pull request #127 from KUSITMS-29th-TEAM-B/feat/#101
Browse files Browse the repository at this point in the history
feat: closed modal 오류
  • Loading branch information
hyo-4 authored May 21, 2024
2 parents bd460b5 + 29057d2 commit 9606e6f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/components/JD/DiscardModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ import { useNavigate } from "react-router-dom";
interface ModalProps {
isOpen: boolean;
onClose: () => void;
jdId: string;
}

const DiscardModal: FC<ModalProps> = ({ isOpen, onClose }) => {
const DiscardModal: FC<ModalProps> = ({ isOpen, onClose, jdId }) => {
const nav = useNavigate();
if (!isOpen) {
return null;
Expand All @@ -34,7 +35,7 @@ const DiscardModal: FC<ModalProps> = ({ isOpen, onClose }) => {
<ConfirmButton
onClick={() => {
onClose();
nav(-1);
nav(`/jd/${jdId}`);
}}
>
<div>네, 취소할래요</div>
Expand Down
6 changes: 5 additions & 1 deletion src/pages/ApplyEditPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,11 @@ const ApplyEditPage: React.FC = () => {
onClose={closeModal}
onCancel={cancelModal}
/>
<DiscardModal isOpen={discardModal} onClose={closeDiscardModal} />
<DiscardModal
isOpen={discardModal}
onClose={closeDiscardModal}
jdId={jdId}
/>
<MainContainer>
<CenteredContainer
initial={{ width: "100%" }}
Expand Down
6 changes: 5 additions & 1 deletion src/pages/ApplyPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,11 @@ const ApplyPage: React.FC = () => {
onClose={closeModal}
onCancel={cancelModal}
/>
<DiscardModal isOpen={discardModal} onClose={closeDiscardModal} />
<DiscardModal
isOpen={discardModal}
onClose={closeDiscardModal}
jdId={jdId}
/>
<MainContainer>
<CenteredContainer
initial={{ width: "100%" }}
Expand Down

0 comments on commit 9606e6f

Please sign in to comment.