Skip to content

Commit 5544d73

Browse files
committed
fix: 미션카드 랜덤 라벨 노출
1 parent 854fe4e commit 5544d73

File tree

3 files changed

+32
-6
lines changed

3 files changed

+32
-6
lines changed

src/constants/mission.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,23 @@
11
export const MISSION_GUIDE_COMPLETED_KEY = "MISSION_GUIDE_COMPLETED";
2+
3+
export const MISSION_STATUS_MESSAGES = {
4+
success: [
5+
"방금 그 루트 멋지게 완등했어요!",
6+
"이 정도면 다음 루트도 충분해요",
7+
"깔끔하게 올라왔네요",
8+
"조금씩 성장하고 있어요",
9+
"방금 루트 좋았어요!",
10+
],
11+
failed: [
12+
"시도 자체가 멋져요",
13+
"다음엔 더 잘할 수 있어요",
14+
"아쉽지만 괜찮아요",
15+
"다음 도전도 기대돼요",
16+
"이 정도면 절반은 성공!",
17+
],
18+
not_tried: [
19+
"이 루트가 궁금하지 않으신가요?",
20+
"내 레벨에 맞는 추천 루트에요",
21+
"내 실력 상승에 좋은 루트에요",
22+
],
23+
} as const;

src/routes/mission/-components/MissionGridCard.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import { Link } from "@tanstack/react-router";
2+
import { sample } from "es-toolkit/compat";
23
import { Tooltip } from "radix-ui";
34
import Button from "@/components/Button";
45
import { Tag } from "@/components/tag/Tag";
6+
import { MISSION_STATUS_MESSAGES } from "@/constants/mission";
57
import { cn } from "@/utils/cn";
68
import { convertPascalCase } from "@/utils/convert";
79
import { getDiffFromNow } from "@/utils/date";
@@ -141,7 +143,7 @@ export default function MissionGridCard({
141143
<div className="flex items-center gap-1">
142144
{status === "not_tried" ? (
143145
<div className="t-p-14-m text-neutral-100">
144-
이 루트 궁금하지 않으신가요?
146+
{sample(MISSION_STATUS_MESSAGES.not_tried)}
145147
</div>
146148
) : (
147149
<>
@@ -152,8 +154,8 @@ export default function MissionGridCard({
152154
)}
153155
<div className="t-p-14-m">
154156
{status === "success"
155-
? "완등 ! 대단히 상당히 멋져요!"
156-
: "한 번 더 도전해보세요!"}
157+
? sample(MISSION_STATUS_MESSAGES.success)
158+
: sample(MISSION_STATUS_MESSAGES.failed)}
157159
</div>
158160
</>
159161
)}

src/routes/mission/-components/MissionListCard.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import { Link } from "@tanstack/react-router";
2+
import { sample } from "es-toolkit/compat";
3+
import { MISSION_STATUS_MESSAGES } from "@/constants/mission";
24
import { cn } from "@/utils/cn";
35
import { convertPascalCase } from "@/utils/convert";
46

@@ -90,9 +92,9 @@ export default function MissionListCard({
9092
{convertPascalCase(difficulty)}
9193
</div>
9294
<div className="t-p-12-m text-neutral-600 mb-1">
93-
{status === "not_tried" && "이 루트가 궁금하지 않으신가요?"}
94-
{status === "success" && "완등 ! 대단히 상당히 멋져요!"}
95-
{status === "failed" && "한 번 더 도전해보세요!"}
95+
{status === "not_tried" && sample(MISSION_STATUS_MESSAGES.not_tried)}
96+
{status === "success" && sample(MISSION_STATUS_MESSAGES.success)}
97+
{status === "failed" && sample(MISSION_STATUS_MESSAGES.failed)}
9698
</div>
9799
<div className="flex items-center gap-1 t-p-10-sb text-neutral-400">
98100
<span className="w-1 h-1 rounded-full bg-neutral-400" />

0 commit comments

Comments
 (0)