Skip to content

Commit 2b97d18

Browse files
committed
feat: 드라이버 가이드 팝오버 스타일 및 기능 추가, Mission 컴포넌트의 팝오버 내용 수정
1 parent 596f4a1 commit 2b97d18

File tree

5 files changed

+95
-19
lines changed

5 files changed

+95
-19
lines changed

src/hooks/useDriverGuide.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ export function useDriverGuide({
3737
Partial<Config> = useMemo(
3838
() => ({
3939
showProgress: true,
40-
showButtons: ["previous", "next", "close"],
40+
showButtons: ["next"],
41+
nextBtnText: "다음",
42+
progressText: "{{current}}/{{total}}",
4143
}),
4244
[]
4345
);

src/index.css

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,71 @@
1515
@apply flex-[0_0_80vw] max-w-[480px] aspect-[3/4] rounded-[40px] bg-neutral-100 p-2 shadow-[2px_2px_8px_rgba(0,0,0,0.4)] transition-transform duration-300 ease-in-out;
1616
}
1717
}
18+
19+
/* Class assigned to popover wrapper */
20+
.driver-popover {
21+
border-radius: 32px !important;
22+
padding: 20px !important;
23+
}
24+
25+
/* Arrow pointing towards the highlighted element */
26+
.driver-popover-arrow {
27+
display: none;
28+
}
29+
30+
/* Title and description */
31+
.driver-popover-title {
32+
color: #437bfe;
33+
font-family:
34+
"Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, Roboto, "Helvetica Neue", "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", sans-serif;
35+
font-size: 14px;
36+
font-weight: 600;
37+
line-height: 1.4;
38+
letter-spacing: -2.2%;
39+
}
40+
.driver-popover-description {
41+
color: var(--color-neutral-700);
42+
font-family:
43+
"Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, Roboto, "Helvetica Neue", "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", sans-serif;
44+
font-size: 12px;
45+
font-weight: 500;
46+
line-height: 1.4;
47+
letter-spacing: -2.2%;
48+
white-space: pre-line !important;
49+
}
50+
51+
/* Close button displayed on the top right corner */
52+
.driver-popover-close-btn {
53+
display: none !important;
54+
}
55+
56+
/* Footer of the popover displaying progress and navigation buttons */
57+
.driver-popover-footer {
58+
}
59+
.driver-popover-progress-text {
60+
}
61+
62+
.driver-popover-footer button {
63+
width: 53px !important;
64+
height: 33px !important;
65+
border-radius: 24px !important;
66+
background: #4d5761 !important;
67+
color: #fcfcfd !important;
68+
font-family:
69+
"Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, Roboto, "Helvetica Neue", "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", sans-serif !important;
70+
font-size: 12px !important;
71+
font-weight: 500 !important;
72+
line-height: 1.4 !important;
73+
letter-spacing: -2.2% !important;
74+
border: none !important;
75+
text-shadow: none !important;
76+
padding: 0 !important;
77+
78+
display: flex !important;
79+
align-items: center !important;
80+
justify-content: center !important;
81+
}
82+
83+
.driver-popover-footer button:disabled {
84+
display: none !important;
85+
}

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ import { cn } from "@/utils/cn";
44

55
export default function MissionLockCard() {
66
return (
7-
<div className={cn("card-container", "max-w-[380px]")}>
7+
<div
8+
className={cn("card-container", "max-w-[380px]")}
9+
id="mission-lock-card"
10+
>
811
<div className="relative w-full h-full rounded-[32px]">
912
<div className="h-full flex flex-col items-center justify-center gap-2 relative z-1 bg-neutral-400 rounded-[32px]">
1013
<img

src/routes/mission/index.tsx

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,10 @@ function Mission() {
137137
{
138138
element: "#timer-play-button",
139139
popover: {
140-
align: "center",
140+
align: "end",
141141
side: "top",
142142
title: "세션 시작",
143+
disableButtons: ["previous"],
143144
description: "재생 버튼을 누르면 오늘의 세션을 시작해요.",
144145
onNextClick: () => {
145146
setShowMockStopButton(true);
@@ -148,12 +149,13 @@ function Mission() {
148149
},
149150
},
150151
{
151-
element: "#mission-carousel",
152+
element: "#mission-lock-card",
152153
popover: {
153154
align: "center",
154-
side: "bottom",
155+
side: "over",
155156
title: "루트 미션",
156-
description: "내 레벨에 맞는 미션에 도전하고 해설 영상을 확인해보세요.",
157+
disableButtons: ["previous"],
158+
description: "내 난이도에 맞는 미션을 추천해드려요.",
157159
},
158160
},
159161
{
@@ -162,8 +164,9 @@ function Mission() {
162164
align: "center",
163165
side: "top",
164166
title: "세션 종료",
165-
description:
166-
"멈춤 버튼을 길게 누르면 오늘의 세션이 종료돼요. 종료 후 기록을 확인할 수 있어요.",
167+
description: `정지 버튼을 길게 누르면 세션이 끝나요.\n끝난 뒤엔 기록을 확인할 수 있어요.`,
168+
disableButtons: ["previous"],
169+
doneBtnText: "시작하기",
167170
onNextClick: () => {
168171
stop();
169172
},

src/third-party/queryClient.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,17 @@ export const customQueryClient = new QueryClient({
1111
},
1212
queryCache: new QueryCache({
1313
onError: (error) => {
14-
if (error instanceof AxiosError) {
15-
if (error.response?.status === 401) {
16-
router.navigate({ to: "/" });
17-
}
18-
if (error.response?.status === 302) {
19-
router.navigate({ to: "/" });
20-
}
21-
if (!error.response?.data) {
22-
router.navigate({ to: "/" });
23-
}
24-
}
14+
// if (error instanceof AxiosError) {
15+
// if (error.response?.status === 401) {
16+
// router.navigate({ to: "/" });
17+
// }
18+
// if (error.response?.status === 302) {
19+
// router.navigate({ to: "/" });
20+
// }
21+
// if (!error.response?.data) {
22+
// router.navigate({ to: "/" });
23+
// }
24+
// }
2525
},
2626
}),
2727
});

0 commit comments

Comments
 (0)