Skip to content

Commit 74b27c0

Browse files
authored
Merge pull request depromeet#635 from depromeet/634-홈-화면-작성중인-회고-진입-불가
feat: 홈 화면 작성중인 회고 연결 작업
2 parents 2658f51 + 1eb3127 commit 74b27c0

2 files changed

Lines changed: 19 additions & 5 deletions

File tree

  • apps/web/src

apps/web/src/app/desktop/component/home/RetrospectCard/index.tsx

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,20 @@ export default function RetrospectCard({ retrospect, spaceId }: RetrospectCardPr
2020
const [searchParams] = useSearchParams();
2121
const { openFunnelModal } = useFunnelModal();
2222

23-
const { retrospectId, title, introduction, deadline, totalCount, writeCount, writeStatus, retrospectStatus, analysisStatus } = retrospect;
23+
const {
24+
spaceId: retrospectSpaceId,
25+
retrospectId,
26+
title,
27+
introduction,
28+
deadline,
29+
totalCount,
30+
writeCount,
31+
writeStatus,
32+
retrospectStatus,
33+
analysisStatus,
34+
} = retrospect;
35+
36+
const targetSpaceId = spaceId ?? retrospectSpaceId;
2437

2538
const urlRetrospectId = searchParams.get("retrospectId");
2639
const isSelected = urlRetrospectId && parseInt(urlRetrospectId) === retrospectId;
@@ -29,17 +42,17 @@ export default function RetrospectCard({ retrospect, spaceId }: RetrospectCardPr
2942
// TODO: spaceId가 없는 경우 처리(예: 홈 화면 최상단의 카드 클릭 시)
3043

3144
// 진행중인 회고 클릭 시
32-
if (spaceId && retrospectStatus === "PROCEEDING") {
45+
if (targetSpaceId && retrospectStatus === "PROCEEDING") {
3346
openFunnelModal({
3447
title: "",
3548
step: "retrospectWrite",
36-
contents: <Prepare spaceId={Number(spaceId)} retrospectId={retrospect.retrospectId} title={title} introduction={introduction} />,
49+
contents: <Prepare spaceId={Number(targetSpaceId)} retrospectId={retrospect.retrospectId} title={title} introduction={introduction} />,
3750
});
3851
}
3952

4053
// 마감된 회고 클릭 시
41-
if (spaceId && retrospectStatus === "DONE") {
42-
navigate(PATHS.retrospectAnalysis(spaceId, retrospectId, title));
54+
if (targetSpaceId && retrospectStatus === "DONE") {
55+
navigate(PATHS.retrospectAnalysis(String(targetSpaceId), retrospectId, title));
4356
}
4457
};
4558

apps/web/src/types/retrospect/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ export type RetrospectStatus = "PROCEEDING" | "DONE";
33
export type AnalysisStatus = "NOT_STARTED" | "PROCEEDING" | "DONE";
44

55
export type Retrospect = {
6+
spaceId: number;
67
retrospectId: number;
78
title: string;
89
introduction: string;

0 commit comments

Comments
 (0)