Skip to content

Commit

Permalink
fix: challenge get API에서 location, 태그 삭제
Browse files Browse the repository at this point in the history
  • Loading branch information
iOdiO89 committed Jul 2, 2024
1 parent bbfeed8 commit 03e8514
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 34 deletions.
1 change: 0 additions & 1 deletion apis/challenge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ export interface Challenge {
challengeIdx: number;
name: string;
participantsCount: number;
location: string;
locatedPlace: string;
schedule: string;
myAttendanceRate: number;
Expand Down
13 changes: 3 additions & 10 deletions components/home/adminChallenge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import FlexBox from "../Flexbox";
import { useRouter } from "next/router";
import { Challenge as ChallengeType } from "@/apis/challenge";
import { usePostAttendanceCode } from "@/apis/hooks/admin";
import Tag from "./tag";

interface ChallengeProps {
setIsModalVisible: React.Dispatch<React.SetStateAction<boolean>>;
Expand All @@ -22,18 +21,12 @@ const AdminChallenge: NextPage<ChallengeProps> = ({
return (
<FlexBox direction="col" className="p-4 w-full rounded-lg border gap-4">
<FlexBox direction="col" className="w-full gap-1">
<FlexBox className="w-full items-center gap-2">
<FlexBox className="w-full items-start">
<div className="h2">{challengeInfo.name}</div>
<FlexBox className="gap-1">
{challengeInfo.location !== null ? (
<Tag name={challengeInfo.location} />
) : null}
<Tag name="예술(변경필)" />
</FlexBox>
</FlexBox>
<div className="h4 self-start">
{challengeInfo.locatedPlace ?? challengeInfo.location} |{" "}
{challengeInfo.schedule}
{challengeInfo.locatedPlace ? `${challengeInfo.locatedPlace} | ` : ""}
매주 {challengeInfo.schedule}요일
</div>
</FlexBox>
<FlexBox direction="col" className="w-full gap-2">
Expand Down
15 changes: 3 additions & 12 deletions components/home/challenge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { useRouter } from "next/router";
import { Challenge as ChallengeType } from "@/apis/challenge";
import { useAtom } from "jotai";
import { challengeIdxAtom } from "@/utils/atom";
import Tag from "./tag";

interface ChallengeProps {
setIsModalVisible: React.Dispatch<React.SetStateAction<boolean>>;
Expand All @@ -31,22 +30,14 @@ const Challenge: NextPage<ChallengeProps> = ({
onClick={() => router.push("/challenge")}
>
<FlexBox className="w-full justify-between items-start">
<FlexBox className="gap-2">
<div className="h2">{challengeInfo.name}</div>
<FlexBox className="gap-1">
{challengeInfo.location !== null ? (
<Tag name={challengeInfo.location} />
) : null}
<Tag name="예술(변경필)" />
</FlexBox>
</FlexBox>
<div className="h2">{challengeInfo.name}</div>
<div className="h4 text-grey-500">
{challengeInfo.participantsCount}명 참여 중
</div>
</FlexBox>
<div className="h4 self-start">
{challengeInfo.locatedPlace ?? challengeInfo.location} | 매주{" "}
{challengeInfo.schedule}요일
{challengeInfo.locatedPlace ? `${challengeInfo.locatedPlace} | ` : ""}
매주 {challengeInfo.schedule}요일
</div>
</FlexBox>
<FlexBox direction="col" className="w-full gap-1">
Expand Down
11 changes: 0 additions & 11 deletions components/home/tag.tsx

This file was deleted.

0 comments on commit 03e8514

Please sign in to comment.