Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
SeungJL committed Nov 17, 2024
1 parent c42b365 commit c09e2bd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions components/molecules/cards/GroupThumbnailCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const VOTER_SHOW_MAX = 4;
export interface GroupThumbnailCardProps {
title: string;
text: string;
status: GroupStatus;
status: GroupStatus | "ready";
category: IGroupWritingCategory;
participants: (GroupParicipantProps | { user: IUserSummary })[];
imageProps: {
Expand Down Expand Up @@ -53,12 +53,13 @@ export function GroupThumbnailCard({
: { image: ABOUT_USER_SUMMARY.profileImage },
);

const statusToBadgeProps: Record<GroupStatus, { text: string; colorScheme: string }> = {
const statusToBadgeProps: Record<GroupStatus | "ready", { text: string; colorScheme: string }> = {
imminent: { text: `마감까지 ${maxCnt - participants.length}명`, colorScheme: "red" },
full: { text: "인원마감", colorScheme: "orange" },
waiting: { text: "오픈대기중", colorScheme: "red" },
pending: { text: "모집중", colorScheme: "mint" },
end: { text: "종료", colorScheme: "gray" },
ready: { text: "오픈 예정", colorScheme: "purple" },
};

return (
Expand Down
4 changes: 2 additions & 2 deletions pages/group/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Box, Flex } from "@chakra-ui/react";
import { useRouter, useSearchParams } from "next/navigation";
import { useSession } from "next-auth/react";
import { useRouter, useSearchParams } from "next/navigation";
import { useEffect, useRef, useState } from "react";
import { useSetRecoilState } from "recoil";
import styled from "styled-components";
Expand Down Expand Up @@ -235,7 +235,7 @@ function GroupPage() {
<GroupThumbnailCard
title={group.title}
text={group.guide}
status={status}
status={group.participants.length <= 1 ? "ready" : status}
category={group.category}
participants={group.participants.map((user) =>
group.isSecret ? { user: ABOUT_USER_SUMMARY } : user,
Expand Down

0 comments on commit c09e2bd

Please sign in to comment.