Skip to content

Commit 57833f8

Browse files
committed
issue #192 feat: add team schedule status
1 parent da92b0f commit 57833f8

File tree

3 files changed

+18
-6
lines changed

3 files changed

+18
-6
lines changed

src/components/Team/TeamSchedule/TeamSchedule.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ const TeamSchedule = () => {
8282
<Flex tag="button" css={teamScheduleSearchButtonStyle}>
8383
<Text size="xSmall">일정 검색</Text>
8484
</Flex>
85+
<Flex tag="button" css={teamScheduleSearchButtonStyle}>
86+
<Text size="xSmall">초기화</Text>
87+
</Flex>
8588
</Flex>
8689
</Form>
8790
</Flex>

src/components/Team/TeamSchedule/TeamScheduleCard/TeamScheduleCard.tsx

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
import { Box, Flex, Heading, Text } from "@/components/common";
2+
import { format } from "date-fns";
3+
4+
import { getTeamScheduleStatus } from "@/utils/getTeamScheduleStatus";
25

36
import type { TeamScheduleType } from "@/types/schedule";
47

@@ -11,19 +14,23 @@ import {
1114
} from "@/components/Team/TeamSchedule/TeamScheduleCard/TeamScheduleCard.style";
1215

1316
const TeamScheduleCard = ({ teamScheduleData }: { teamScheduleData: TeamScheduleType }) => {
14-
const { teamColor, title, startDate, endDate, status = true } = teamScheduleData;
17+
const { teamColor, title, startDate, endDate, status } = teamScheduleData;
18+
const scheduleStatusString = getTeamScheduleStatus(status);
19+
1520
return (
1621
<Box css={teamScheduleCardBoxStyle}>
1722
<Flex css={teamScheduleCardHeaderBoxStyle}>
1823
<Heading style={{ textOverflow: "ellipsis" }} size="xSmall">
1924
{title}
2025
</Heading>
21-
<Flex css={teamScheduleCardStatusBoxStyle(true)}>{status ? "진행중" : "마감"}</Flex>
26+
<Flex css={teamScheduleCardStatusBoxStyle(status !== "CLOSING")}>
27+
{scheduleStatusString}
28+
</Flex>
2229
</Flex>
23-
<Text>{startDate} ~</Text>
24-
<Text>{endDate}</Text>
30+
<Text>{format(startDate, "yyyy년 M월 dd일 a HH:mm")}</Text>
31+
<Text>{format(endDate, "yyyy년 M월 dd일 a HH:mm")}</Text>
2532
<Flex style={{ alignItems: "center", justifyContent: "space-between" }}>
26-
{status && (
33+
{status !== "CLOSING" && (
2734
<>
2835
<Flex style={{ alignItems: "center" }}>
2936
겹치는 일정 <Text css={teamScheduleOverlapCount(teamColor)}>0</Text>

src/types/schedule.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,12 @@ export interface TeamScheduleType {
1616
startDate: string;
1717
endDate: string;
1818
createdDate: string;
19-
status: string;
19+
status: TeamScheduleStatusType;
2020
member: Array<TeamMemberType>;
2121
}
2222

23+
export type TeamScheduleStatusType = "IN_PROGRESS" | "UPCOMING" | "CLOSING";
24+
2325
interface TeamScheduleResultType {
2426
scheduleList: Array<TeamScheduleType>;
2527
nextPageParam: number;

0 commit comments

Comments
 (0)