Skip to content

Commit

Permalink
Refactor: 리뷰 모달 postId prop으로 내려주기 (#335)
Browse files Browse the repository at this point in the history
  • Loading branch information
hankim0904 authored Apr 4, 2024
1 parent b1bd299 commit 7c7b2f1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion co-kkiri/src/components/commons/Card/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export default function Card({ page = "home", cardData }: CardProps) {
</S.FooterBox>
</S.Container>
</Link>
{isReviewModalOpen && <ReviewModal onClose={handleReviewModalOpen} />}
{isReviewModalOpen && <ReviewModal onClose={handleReviewModalOpen} postId={postId} />}
</>
);
}
2 changes: 1 addition & 1 deletion co-kkiri/src/components/domains/manage/Buttons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export default function Buttons({ buttonType, isLeader, postId, studyType, isRev
{buttonType === "DONE" && (
<ManageButton text="내가 받은 리뷰 보기" buttonCount={1} variant="ghost" onClick={handleReviewModalOpen} />
)}
{isReviewModalOpen && <ReviewModal onClose={handleReviewModalOpen} />}
{isReviewModalOpen && <ReviewModal onClose={handleReviewModalOpen} postId={postId} />}
</Box>
);
}
Expand Down
7 changes: 3 additions & 4 deletions co-kkiri/src/components/modals/ReviewModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@ import { TEAM_REVIEW_INFO, emojis } from "@/lib/mock/review/teamReview.ts";

interface ReviewModalProps {
onClose: () => void;
postId: number;
}

export default function ReviewModal({ onClose }: ReviewModalProps) {
const { id } = useParams();
const postId = Number(id);
export default function ReviewModal({ onClose, postId }: ReviewModalProps) {
const selectedEmojisRef = useRef<string[]>([]);

const randomPicker = () => {
Expand All @@ -38,7 +37,7 @@ export default function ReviewModal({ onClose }: ReviewModalProps) {
<h3>스터디 리뷰</h3>
<S.Box>
<S.ContentBox>
<Link to={`/list/${id}`}>
<Link to={`/list/${postId}`}>
<h6>
스터디/프로젝트
<img src={ICONS.arrowRightGray.src} alt={ICONS.arrowRightGray.alt} />
Expand Down

0 comments on commit 7c7b2f1

Please sign in to comment.