@tipp/ui 2.3.1 → 2.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app/index.cjs.map +1 -1
- package/dist/app/index.js +35 -35
- package/dist/app/platform/coach-question-list.cjs.map +1 -1
- package/dist/app/platform/coach-question-list.js +2 -2
- package/dist/app/platform/contents-card.cjs.map +1 -1
- package/dist/app/platform/contents-card.js +3 -3
- package/dist/app/platform/curriculum-card.cjs.map +1 -1
- package/dist/app/platform/curriculum-card.js +2 -2
- package/dist/app/platform/edit-coaching-time.cjs.map +1 -1
- package/dist/app/platform/edit-coaching-time.js +22 -22
- package/dist/app/platform/edit-service-type.cjs.map +1 -1
- package/dist/app/platform/edit-service-type.js +21 -21
- package/dist/app/platform/goal-manage-card-edit.cjs.map +1 -1
- package/dist/app/platform/goal-manage-card-edit.js +22 -22
- package/dist/app/platform/goal-manage-card-read.cjs.map +1 -1
- package/dist/app/platform/goal-manage-card-read.js +3 -3
- package/dist/app/platform/on-offline-radio-card.cjs.map +1 -1
- package/dist/app/platform/on-offline-radio-card.js +21 -21
- package/dist/app/platform/report-card.cjs.map +1 -1
- package/dist/app/platform/report-card.js +3 -3
- package/dist/app/platform/reservation-card.cjs.map +1 -1
- package/dist/app/platform/reservation-card.js +22 -22
- package/dist/app/platform/session-card.cjs.map +1 -1
- package/dist/app/platform/session-card.js +23 -23
- package/dist/app/platform/session-review-simple-read.cjs.map +1 -1
- package/dist/app/platform/session-review-simple-read.js +2 -2
- package/dist/app/platform/userInfos/coaching-customer-info/index.cjs.map +1 -1
- package/dist/app/platform/userInfos/coaching-customer-info/index.js +2 -2
- package/dist/app/platform/userInfos/coaching-customer-info/large.cjs.map +1 -1
- package/dist/app/platform/userInfos/coaching-customer-info/large.js +2 -2
- package/dist/app/platform/userInfos/coaching-customer-info/medium.cjs.map +1 -1
- package/dist/app/platform/userInfos/coaching-customer-info/medium.js +2 -2
- package/dist/app/platform/userInfos/coaching-customer-info/small.cjs.map +1 -1
- package/dist/app/platform/userInfos/coaching-customer-info/small.js +2 -2
- package/dist/app/platform/userInfos/session-user-info-detail.cjs.map +1 -1
- package/dist/app/platform/userInfos/session-user-info-detail.js +2 -2
- package/dist/app/platform/userInfos/utils.cjs.map +1 -1
- package/dist/app/platform/userInfos/utils.js +2 -2
- package/dist/atoms/index.cjs.map +1 -1
- package/dist/atoms/index.js +2 -2
- package/dist/atoms/pagination.cjs.map +1 -1
- package/dist/atoms/pagination.js +2 -2
- package/dist/chunk-55RMETSZ.js +89 -0
- package/dist/chunk-55RMETSZ.js.map +1 -0
- package/dist/chunk-5NA6TNVC.js +54 -0
- package/dist/chunk-5NA6TNVC.js.map +1 -0
- package/dist/chunk-65AC2AKZ.js +117 -0
- package/dist/chunk-65AC2AKZ.js.map +1 -0
- package/dist/chunk-6CTQK5X5.js +196 -0
- package/dist/chunk-6CTQK5X5.js.map +1 -0
- package/dist/chunk-6PUQK6YK.js +99 -0
- package/dist/chunk-6PUQK6YK.js.map +1 -0
- package/dist/chunk-7YI6WBLJ.js +144 -0
- package/dist/chunk-7YI6WBLJ.js.map +1 -0
- package/dist/chunk-AYAO3MO4.js +69 -0
- package/dist/chunk-AYAO3MO4.js.map +1 -0
- package/dist/chunk-BW2VENFR.js +100 -0
- package/dist/chunk-BW2VENFR.js.map +1 -0
- package/dist/chunk-C6I6QXIL.js +228 -0
- package/dist/chunk-C6I6QXIL.js.map +1 -0
- package/dist/chunk-CCNYHZOR.js +169 -0
- package/dist/chunk-CCNYHZOR.js.map +1 -0
- package/dist/chunk-DAGMEXFD.js +174 -0
- package/dist/chunk-DAGMEXFD.js.map +1 -0
- package/dist/chunk-GOXSOL2S.js +145 -0
- package/dist/chunk-GOXSOL2S.js.map +1 -0
- package/dist/chunk-HWIBGZAC.js +165 -0
- package/dist/chunk-HWIBGZAC.js.map +1 -0
- package/dist/chunk-MPEEG7OO.js +64 -0
- package/dist/chunk-MPEEG7OO.js.map +1 -0
- package/dist/chunk-NYDG7SPN.js +63 -0
- package/dist/chunk-NYDG7SPN.js.map +1 -0
- package/dist/chunk-P7ZFJHY5.js +233 -0
- package/dist/chunk-P7ZFJHY5.js.map +1 -0
- package/dist/chunk-R2LFT26A.js +192 -0
- package/dist/chunk-R2LFT26A.js.map +1 -0
- package/dist/chunk-R7IT4TCD.js +139 -0
- package/dist/chunk-R7IT4TCD.js.map +1 -0
- package/dist/chunk-SVFDAVBS.js +70 -0
- package/dist/chunk-SVFDAVBS.js.map +1 -0
- package/dist/chunk-SWAF52SS.js +363 -0
- package/dist/chunk-SWAF52SS.js.map +1 -0
- package/dist/chunk-TDC2MDRA.js +68 -0
- package/dist/chunk-TDC2MDRA.js.map +1 -0
- package/dist/chunk-XEM7S4HK.js +79 -0
- package/dist/chunk-XEM7S4HK.js.map +1 -0
- package/dist/chunk-YJZJOZMK.js +125 -0
- package/dist/chunk-YJZJOZMK.js.map +1 -0
- package/dist/chunk-Z42FOTXC.js +87 -0
- package/dist/chunk-Z42FOTXC.js.map +1 -0
- package/dist/chunk-ZN5L462B.js +75 -0
- package/dist/chunk-ZN5L462B.js.map +1 -0
- package/dist/icon.cjs +2 -0
- package/dist/icon.cjs.map +1 -1
- package/dist/icon.d.cts +1 -1
- package/dist/icon.d.ts +1 -1
- package/dist/icon.js +3 -1
- package/dist/index.cjs +2 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +49 -47
- package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/ReviewQuestion/index.cjs.map +1 -1
- package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/ReviewQuestion/index.js +5 -5
- package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/ReviewQuestion/review-comp.cjs.map +1 -1
- package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/ReviewQuestion/review-comp.js +1 -1
- package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/ReviewQuestion/review-question-body.cjs.map +1 -1
- package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/ReviewQuestion/review-question-body.js +3 -3
- package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/ReviewQuestion/review-question-footer.cjs.map +1 -1
- package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/ReviewQuestion/review-question-footer.js +2 -2
- package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/ReviewQuestion/review-question-radio.cjs.map +1 -1
- package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/ReviewQuestion/review-question-radio.js +1 -1
- package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/ReviewQuestion/review-question-satisfaction-option.cjs.map +1 -1
- package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/ReviewQuestion/review-question-satisfaction-option.js +1 -1
- package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/ReviewQuestion/review-question-satisfaction-text.cjs.map +1 -1
- package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/ReviewQuestion/review-question-satisfaction-text.js +1 -1
- package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/ReviewQuestion/review-question-text.cjs.map +1 -1
- package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/ReviewQuestion/review-question-text.js +2 -2
- package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/complete-review.cjs.map +1 -1
- package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/complete-review.js +2 -2
- package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/index.cjs.map +1 -1
- package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/index.js +7 -7
- package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/start-review.cjs.map +1 -1
- package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/start-review.js +1 -1
- package/dist/molecules/curriculumV2/CurriculumContents/curriculum-ai-traning.cjs.map +1 -1
- package/dist/molecules/curriculumV2/CurriculumContents/curriculum-ai-traning.js +2 -2
- package/dist/molecules/curriculumV2/CurriculumContents/curriculum-review.cjs.map +1 -1
- package/dist/molecules/curriculumV2/CurriculumContents/curriculum-review.js +8 -8
- package/dist/molecules/curriculumV2/CurriculumContents/index.cjs.map +1 -1
- package/dist/molecules/curriculumV2/CurriculumContents/index.js +10 -10
- package/dist/molecules/curriculumV2/CurriculumSidebar/Items/section-item.cjs.map +1 -1
- package/dist/molecules/curriculumV2/CurriculumSidebar/Items/section-item.js +1 -1
- package/dist/molecules/curriculumV2/CurriculumSidebar/index.cjs.map +1 -1
- package/dist/molecules/curriculumV2/CurriculumSidebar/index.js +1 -1
- package/dist/molecules/curriculumV2/CurriculumSidebar/sidebar-item.cjs.map +1 -1
- package/dist/molecules/curriculumV2/CurriculumSidebar/sidebar-item.js +1 -1
- package/dist/molecules/curriculumV2/curriculum-sub-nav.cjs.map +1 -1
- package/dist/molecules/curriculumV2/curriculum-sub-nav.js +2 -2
- package/dist/molecules/curriculumV2/index.cjs.map +1 -1
- package/dist/molecules/curriculumV2/index.js +11 -11
- package/dist/molecules/date-picker/date-picker-button.cjs.map +1 -1
- package/dist/molecules/date-picker/date-picker-button.js +3 -3
- package/dist/molecules/date-picker/index.cjs.map +1 -1
- package/dist/molecules/date-picker/index.js +2 -2
- package/dist/molecules/expand-table/index.cjs.map +1 -1
- package/dist/molecules/expand-table/index.js +3 -3
- package/dist/molecules/index.cjs.map +1 -1
- package/dist/molecules/index.js +32 -32
- package/dist/molecules/stepper.cjs.map +1 -1
- package/dist/molecules/stepper.js +2 -2
- package/dist/molecules/tag-selector.cjs.map +1 -1
- package/dist/molecules/tag-selector.js +2 -2
- package/dist/molecules/time-select.js +1 -1
- package/dist/utils/curriculum.utils.cjs.map +1 -1
- package/dist/utils/curriculum.utils.js +1 -1
- package/dist/utils/index.js +3 -3
- package/package.json +1 -1
- package/src/icon.ts +1 -0
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CurriculumReviewSteps_default
|
|
3
|
+
} from "./chunk-55RMETSZ.js";
|
|
4
|
+
import {
|
|
5
|
+
useCurriculumContext
|
|
6
|
+
} from "./chunk-IYQJIEVM.js";
|
|
7
|
+
import {
|
|
8
|
+
Dialog
|
|
9
|
+
} from "./chunk-U5DI2EGA.js";
|
|
10
|
+
import {
|
|
11
|
+
IconButton
|
|
12
|
+
} from "./chunk-XK6VEVOK.js";
|
|
13
|
+
import {
|
|
14
|
+
Flex
|
|
15
|
+
} from "./chunk-25HMMI7R.js";
|
|
16
|
+
import {
|
|
17
|
+
Button
|
|
18
|
+
} from "./chunk-ZVDAEY5Q.js";
|
|
19
|
+
import {
|
|
20
|
+
Box
|
|
21
|
+
} from "./chunk-4Y5BEXVN.js";
|
|
22
|
+
import {
|
|
23
|
+
Typo
|
|
24
|
+
} from "./chunk-PMJIFLDT.js";
|
|
25
|
+
import {
|
|
26
|
+
__spreadValues
|
|
27
|
+
} from "./chunk-CRTRMMJ7.js";
|
|
28
|
+
|
|
29
|
+
// src/molecules/curriculumV2/CurriculumContents/curriculum-review.tsx
|
|
30
|
+
import { useCallback, useMemo, useState } from "react";
|
|
31
|
+
import { Cross1Icon } from "@radix-ui/react-icons";
|
|
32
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
33
|
+
function CurriculumReview(props) {
|
|
34
|
+
const { item, sectionTitle } = props;
|
|
35
|
+
const { description, buttonTitle } = item;
|
|
36
|
+
const {
|
|
37
|
+
curriculum,
|
|
38
|
+
onReviewSubmit: _onReviewSubmit,
|
|
39
|
+
onReviewValueChange: _onReviewValueChange,
|
|
40
|
+
curriculumReviewAnswers,
|
|
41
|
+
tempCurriculumReviewAnswers,
|
|
42
|
+
curriculumCompleteMap
|
|
43
|
+
} = useCurriculumContext();
|
|
44
|
+
const [open, setOpen] = useState(false);
|
|
45
|
+
const [isChanged, setIsChanged] = useState(false);
|
|
46
|
+
const [closeDialogOpen, setCloseDialogOpen] = useState(false);
|
|
47
|
+
const onReviewValueChange = useCallback(
|
|
48
|
+
({
|
|
49
|
+
reviewId,
|
|
50
|
+
answer
|
|
51
|
+
}) => {
|
|
52
|
+
if (curriculumReviewAnswers[reviewId] === answer[reviewId]) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
setIsChanged(true);
|
|
56
|
+
_onReviewValueChange({ reviewId, answer });
|
|
57
|
+
},
|
|
58
|
+
[_onReviewValueChange, curriculumReviewAnswers]
|
|
59
|
+
);
|
|
60
|
+
const onReviewSubmit = useCallback(
|
|
61
|
+
(values) => {
|
|
62
|
+
return _onReviewSubmit({ reviewId: item.uuid, answer: values }).then(
|
|
63
|
+
(result) => {
|
|
64
|
+
setIsChanged(false);
|
|
65
|
+
return result;
|
|
66
|
+
}
|
|
67
|
+
);
|
|
68
|
+
},
|
|
69
|
+
[item.uuid, _onReviewSubmit]
|
|
70
|
+
);
|
|
71
|
+
const onClickEndReview = useCallback(() => {
|
|
72
|
+
setOpen(false);
|
|
73
|
+
}, []);
|
|
74
|
+
const onClickCloseDrawer = useCallback(() => {
|
|
75
|
+
if (isChanged) {
|
|
76
|
+
setCloseDialogOpen(true);
|
|
77
|
+
} else {
|
|
78
|
+
setOpen(false);
|
|
79
|
+
}
|
|
80
|
+
}, [isChanged]);
|
|
81
|
+
const mode = useMemo(() => {
|
|
82
|
+
return item.questions.every(
|
|
83
|
+
(question) => curriculumReviewAnswers[question.uuid] && curriculumReviewAnswers[question.uuid] !== ""
|
|
84
|
+
) ? "edit" : "create";
|
|
85
|
+
}, [curriculumReviewAnswers, item.questions]);
|
|
86
|
+
const defaultValues = useMemo(() => {
|
|
87
|
+
const allAnswers = __spreadValues(__spreadValues({}, tempCurriculumReviewAnswers), curriculumReviewAnswers);
|
|
88
|
+
return item.questions.reduce((acc, question) => {
|
|
89
|
+
acc[question.uuid] = allAnswers[question.uuid] || "";
|
|
90
|
+
return acc;
|
|
91
|
+
}, {});
|
|
92
|
+
}, [curriculumReviewAnswers, item.questions, tempCurriculumReviewAnswers]);
|
|
93
|
+
const done = useMemo(() => {
|
|
94
|
+
return Boolean(curriculumCompleteMap[item.uuid]);
|
|
95
|
+
}, [curriculumCompleteMap, item.uuid]);
|
|
96
|
+
const bgColor = done ? "var(--color-panel-solid)" : void 0;
|
|
97
|
+
return /* @__PURE__ */ jsxs(Dialog.Root, { onOpenChange: setOpen, open, children: [
|
|
98
|
+
/* @__PURE__ */ jsxs(
|
|
99
|
+
Flex,
|
|
100
|
+
{
|
|
101
|
+
align: "center",
|
|
102
|
+
direction: "column",
|
|
103
|
+
height: "100%",
|
|
104
|
+
justify: "center",
|
|
105
|
+
px: "3",
|
|
106
|
+
py: "3",
|
|
107
|
+
style: {
|
|
108
|
+
backgroundImage: `url(https://tipp-coaching-live.s3.ap-northeast-2.amazonaws.com/images/curriculum_review_bg.png)`,
|
|
109
|
+
backgroundPosition: "center",
|
|
110
|
+
backgroundSize: "cover",
|
|
111
|
+
backgroundRepeat: "no-repeat"
|
|
112
|
+
},
|
|
113
|
+
width: "100%",
|
|
114
|
+
children: [
|
|
115
|
+
/* @__PURE__ */ jsx(Typo, { color: "gray", weight: "bold", children: curriculum.title }),
|
|
116
|
+
/* @__PURE__ */ jsx(Typo, { align: "center", as: "p", color: "gray", children: description }),
|
|
117
|
+
/* @__PURE__ */ jsx(Dialog.Trigger, { children: /* @__PURE__ */ jsx(
|
|
118
|
+
Button,
|
|
119
|
+
{
|
|
120
|
+
mt: "3",
|
|
121
|
+
style: { minWidth: 232, backgroundColor: bgColor },
|
|
122
|
+
variant: done ? "outline" : "solid",
|
|
123
|
+
children: /* @__PURE__ */ jsx(Typo, { truncate: true, children: done ? "\uB098\uC758 \uC751\uB2F5 \uB2E4\uC2DC\uBCF4\uAE30" : buttonTitle })
|
|
124
|
+
}
|
|
125
|
+
) })
|
|
126
|
+
]
|
|
127
|
+
}
|
|
128
|
+
),
|
|
129
|
+
/* @__PURE__ */ jsx(
|
|
130
|
+
Dialog.Content,
|
|
131
|
+
{
|
|
132
|
+
height: "100%",
|
|
133
|
+
hideCloseButton: true,
|
|
134
|
+
style: { borderRadius: 0, padding: 0 },
|
|
135
|
+
title: "",
|
|
136
|
+
width: "100%",
|
|
137
|
+
children: /* @__PURE__ */ jsxs(
|
|
138
|
+
Flex,
|
|
139
|
+
{
|
|
140
|
+
align: "center",
|
|
141
|
+
height: "100%",
|
|
142
|
+
justify: "center",
|
|
143
|
+
pb: "3",
|
|
144
|
+
position: "relative",
|
|
145
|
+
width: "100%",
|
|
146
|
+
children: [
|
|
147
|
+
/* @__PURE__ */ jsx(
|
|
148
|
+
CurriculumReviewSteps_default,
|
|
149
|
+
{
|
|
150
|
+
contents: item,
|
|
151
|
+
curriculum,
|
|
152
|
+
defaultValues,
|
|
153
|
+
done,
|
|
154
|
+
mode,
|
|
155
|
+
onClickEndReview,
|
|
156
|
+
onReviewValueChange,
|
|
157
|
+
onSubmit: onReviewSubmit,
|
|
158
|
+
title: sectionTitle
|
|
159
|
+
}
|
|
160
|
+
),
|
|
161
|
+
/* @__PURE__ */ jsx(Box, { position: "absolute", right: "16px", top: "16px", children: /* @__PURE__ */ jsxs(
|
|
162
|
+
IconButton,
|
|
163
|
+
{
|
|
164
|
+
color: "gray",
|
|
165
|
+
onClick: onClickCloseDrawer,
|
|
166
|
+
variant: "ghost",
|
|
167
|
+
children: [
|
|
168
|
+
/* @__PURE__ */ jsx(Box, { display: { initial: "none", md: "block" }, children: /* @__PURE__ */ jsx(Cross1Icon, { height: 20, width: 20 }) }),
|
|
169
|
+
/* @__PURE__ */ jsx(Box, { display: { initial: "block", md: "none" }, children: /* @__PURE__ */ jsx(Cross1Icon, { height: 16, width: 16 }) })
|
|
170
|
+
]
|
|
171
|
+
}
|
|
172
|
+
) }),
|
|
173
|
+
/* @__PURE__ */ jsx(Dialog.Root, { onOpenChange: setCloseDialogOpen, open: closeDialogOpen, children: /* @__PURE__ */ jsx(
|
|
174
|
+
Dialog.Content,
|
|
175
|
+
{
|
|
176
|
+
buttons: /* @__PURE__ */ jsxs(Flex, { gap: "3", justify: "end", children: [
|
|
177
|
+
/* @__PURE__ */ jsx(Dialog.Close, { asChild: true, children: /* @__PURE__ */ jsx(Button, { color: "gray", variant: "outline", children: "\uB3CC\uC544\uAC00\uAE30" }) }),
|
|
178
|
+
/* @__PURE__ */ jsx(Dialog.Close, { children: /* @__PURE__ */ jsx(Button, { color: "red", onClick: onClickEndReview, children: "\uB098\uAC00\uAE30" }) })
|
|
179
|
+
] }),
|
|
180
|
+
title: "\uC791\uC131\uC744 \uC911\uB2E8\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",
|
|
181
|
+
children: /* @__PURE__ */ jsx(Typo, { children: "\uD398\uC774\uC9C0\uC5D0\uC11C \uBC97\uC5B4\uB098\uBA74 \uC791\uC131\uD55C \uB0B4\uC6A9\uC774 \uC800\uC7A5\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4." })
|
|
182
|
+
}
|
|
183
|
+
) })
|
|
184
|
+
]
|
|
185
|
+
}
|
|
186
|
+
)
|
|
187
|
+
}
|
|
188
|
+
)
|
|
189
|
+
] });
|
|
190
|
+
}
|
|
191
|
+
var curriculum_review_default = CurriculumReview;
|
|
192
|
+
|
|
193
|
+
export {
|
|
194
|
+
curriculum_review_default
|
|
195
|
+
};
|
|
196
|
+
//# sourceMappingURL=chunk-6CTQK5X5.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/molecules/curriculumV2/CurriculumContents/curriculum-review.tsx"],"sourcesContent":["import React, { useCallback, useMemo, useState } from 'react';\nimport { Cross1Icon } from '@radix-ui/react-icons';\nimport { Box } from '@/atoms/box';\nimport { Button } from '@/atoms/button';\nimport { Dialog } from '@/atoms/dialog';\nimport { Flex } from '@/atoms/flex';\nimport { IconButton } from '@/atoms/icon-button';\nimport { Typo } from '@/atoms/typo';\nimport { type CurriculumReviewContents } from '@/types/curriculumContents.type';\nimport { useCurriculumContext } from '../curriculum-context';\nimport CurriculumReviewSteps from './CurriculumReviewSteps';\n\ninterface CurriculumReviewProps {\n item: CurriculumReviewContents;\n sectionTitle: string | undefined;\n}\n\nfunction CurriculumReview(props: CurriculumReviewProps): React.ReactNode {\n const { item, sectionTitle } = props;\n const { description, buttonTitle } = item;\n const {\n curriculum,\n onReviewSubmit: _onReviewSubmit,\n onReviewValueChange: _onReviewValueChange,\n curriculumReviewAnswers,\n tempCurriculumReviewAnswers,\n curriculumCompleteMap,\n } = useCurriculumContext();\n const [open, setOpen] = useState(false);\n const [isChanged, setIsChanged] = useState(false);\n const [closeDialogOpen, setCloseDialogOpen] = useState(false);\n\n const onReviewValueChange = useCallback(\n ({\n reviewId,\n answer,\n }: {\n reviewId: string;\n answer: Record<string, string>;\n }) => {\n if (curriculumReviewAnswers[reviewId] === answer[reviewId]) {\n return;\n }\n\n setIsChanged(true);\n _onReviewValueChange({ reviewId, answer });\n },\n [_onReviewValueChange, curriculumReviewAnswers]\n );\n\n const onReviewSubmit = useCallback(\n (values: Record<string, string>) => {\n return _onReviewSubmit({ reviewId: item.uuid, answer: values }).then(\n (result) => {\n setIsChanged(false);\n return result;\n }\n );\n },\n [item.uuid, _onReviewSubmit]\n );\n\n const onClickEndReview = useCallback(() => {\n setOpen(false);\n }, []);\n\n const onClickCloseDrawer = useCallback(() => {\n if (isChanged) {\n setCloseDialogOpen(true);\n } else {\n setOpen(false);\n }\n }, [isChanged]);\n\n const mode = useMemo(() => {\n return item.questions.every(\n (question) =>\n curriculumReviewAnswers[question.uuid] &&\n curriculumReviewAnswers[question.uuid] !== ''\n )\n ? 'edit'\n : 'create';\n }, [curriculumReviewAnswers, item.questions]);\n\n const defaultValues = useMemo(() => {\n const allAnswers = {\n ...tempCurriculumReviewAnswers,\n ...curriculumReviewAnswers,\n };\n\n return item.questions.reduce<Record<string, string>>((acc, question) => {\n acc[question.uuid] = allAnswers[question.uuid] || '';\n return acc;\n }, {});\n }, [curriculumReviewAnswers, item.questions, tempCurriculumReviewAnswers]);\n\n const done = useMemo(() => {\n return Boolean(curriculumCompleteMap[item.uuid]);\n }, [curriculumCompleteMap, item.uuid]);\n\n const bgColor = done ? 'var(--color-panel-solid)' : undefined;\n\n return (\n <Dialog.Root onOpenChange={setOpen} open={open}>\n <Flex\n align=\"center\"\n direction=\"column\"\n height=\"100%\"\n justify=\"center\"\n px=\"3\"\n py=\"3\"\n style={{\n backgroundImage: `url(https://tipp-coaching-live.s3.ap-northeast-2.amazonaws.com/images/curriculum_review_bg.png)`,\n backgroundPosition: 'center',\n backgroundSize: 'cover',\n backgroundRepeat: 'no-repeat',\n }}\n width=\"100%\"\n >\n <Typo color=\"gray\" weight=\"bold\">\n {curriculum.title}\n </Typo>\n <Typo align=\"center\" as=\"p\" color=\"gray\">\n {description}\n </Typo>\n\n <Dialog.Trigger>\n <Button\n mt=\"3\"\n style={{ minWidth: 232, backgroundColor: bgColor }}\n variant={done ? 'outline' : 'solid'}\n >\n <Typo truncate>{done ? '나의 응답 다시보기' : buttonTitle}</Typo>\n </Button>\n </Dialog.Trigger>\n </Flex>\n <Dialog.Content\n height=\"100%\"\n hideCloseButton\n style={{ borderRadius: 0, padding: 0 }}\n title=\"\"\n width=\"100%\"\n >\n <Flex\n align=\"center\"\n height=\"100%\"\n justify=\"center\"\n pb=\"3\"\n position=\"relative\"\n width=\"100%\"\n >\n <CurriculumReviewSteps\n contents={item}\n curriculum={curriculum}\n defaultValues={defaultValues}\n done={done}\n mode={mode}\n onClickEndReview={onClickEndReview}\n onReviewValueChange={onReviewValueChange}\n onSubmit={onReviewSubmit}\n title={sectionTitle}\n />\n {/* 닫기 버튼 */}\n <Box position=\"absolute\" right=\"16px\" top=\"16px\">\n <IconButton\n color=\"gray\"\n onClick={onClickCloseDrawer}\n variant=\"ghost\"\n >\n <Box display={{ initial: 'none', md: 'block' }}>\n <Cross1Icon height={20} width={20} />\n </Box>\n <Box display={{ initial: 'block', md: 'none' }}>\n <Cross1Icon height={16} width={16} />\n </Box>\n </IconButton>\n </Box>\n\n {/* 진짜 닫겠습니까 모달 */}\n <Dialog.Root onOpenChange={setCloseDialogOpen} open={closeDialogOpen}>\n <Dialog.Content\n buttons={\n <Flex gap=\"3\" justify=\"end\">\n <Dialog.Close asChild>\n <Button color=\"gray\" variant=\"outline\">\n 돌아가기\n </Button>\n </Dialog.Close>\n <Dialog.Close>\n <Button color=\"red\" onClick={onClickEndReview}>\n 나가기\n </Button>\n </Dialog.Close>\n </Flex>\n }\n title=\"작성을 중단하시겠습니까?\"\n >\n <Typo>페이지에서 벗어나면 작성한 내용이 저장되지 않습니다.</Typo>\n </Dialog.Content>\n </Dialog.Root>\n </Flex>\n </Dialog.Content>\n </Dialog.Root>\n );\n}\n\nexport default CurriculumReview;\n"],"mappings":"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","names":[]}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Grid
|
|
3
|
+
} from "./chunk-EGEQY3KT.js";
|
|
4
|
+
import {
|
|
5
|
+
Separator
|
|
6
|
+
} from "./chunk-HYITAA4J.js";
|
|
7
|
+
import {
|
|
8
|
+
Flex
|
|
9
|
+
} from "./chunk-25HMMI7R.js";
|
|
10
|
+
import {
|
|
11
|
+
Badge
|
|
12
|
+
} from "./chunk-U3BQT7ZO.js";
|
|
13
|
+
import {
|
|
14
|
+
Box
|
|
15
|
+
} from "./chunk-4Y5BEXVN.js";
|
|
16
|
+
import {
|
|
17
|
+
ArrowRightIcon,
|
|
18
|
+
TimerIcon
|
|
19
|
+
} from "./chunk-R7IT4TCD.js";
|
|
20
|
+
import {
|
|
21
|
+
Heading
|
|
22
|
+
} from "./chunk-BESTU2AY.js";
|
|
23
|
+
import {
|
|
24
|
+
Typo
|
|
25
|
+
} from "./chunk-PMJIFLDT.js";
|
|
26
|
+
|
|
27
|
+
// src/app/platform/curriculum-card.tsx
|
|
28
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
29
|
+
function CurriculumCard(props) {
|
|
30
|
+
const {
|
|
31
|
+
title,
|
|
32
|
+
imgTitle,
|
|
33
|
+
imgSrc,
|
|
34
|
+
description,
|
|
35
|
+
runningTime,
|
|
36
|
+
bgColor,
|
|
37
|
+
onClick
|
|
38
|
+
} = props;
|
|
39
|
+
return /* @__PURE__ */ jsxs(
|
|
40
|
+
Grid,
|
|
41
|
+
{
|
|
42
|
+
columns: { initial: "1", sm: "275px 1fr" },
|
|
43
|
+
gapX: "5",
|
|
44
|
+
gapY: "2",
|
|
45
|
+
onClick,
|
|
46
|
+
style: { cursor: "pointer" },
|
|
47
|
+
children: [
|
|
48
|
+
/* @__PURE__ */ jsx(
|
|
49
|
+
Box,
|
|
50
|
+
{
|
|
51
|
+
height: "165px",
|
|
52
|
+
p: "3",
|
|
53
|
+
style: {
|
|
54
|
+
backgroundImage: `url(${imgSrc})`,
|
|
55
|
+
backgroundColor: bgColor,
|
|
56
|
+
backgroundPositionX: "right",
|
|
57
|
+
backgroundPositionY: "bottom",
|
|
58
|
+
backgroundRepeat: "no-repeat",
|
|
59
|
+
backgroundSize: "contain",
|
|
60
|
+
backgroundAttachment: "local"
|
|
61
|
+
},
|
|
62
|
+
width: "100%",
|
|
63
|
+
children: /* @__PURE__ */ jsx(Heading, { style: { whiteSpace: "break-spaces" }, variant: "heading3", children: imgTitle })
|
|
64
|
+
}
|
|
65
|
+
),
|
|
66
|
+
/* @__PURE__ */ jsxs(Flex, { direction: "column", gap: "3", children: [
|
|
67
|
+
/* @__PURE__ */ jsxs(Grid, { columns: { initial: "1", xs: "1fr auto" }, gapY: "3", children: [
|
|
68
|
+
/* @__PURE__ */ jsx(Heading, { variant: "heading4", children: title }),
|
|
69
|
+
/* @__PURE__ */ jsx(
|
|
70
|
+
Badge,
|
|
71
|
+
{
|
|
72
|
+
size: "medium",
|
|
73
|
+
style: { justifySelf: "flex-start" },
|
|
74
|
+
variant: "outline",
|
|
75
|
+
children: /* @__PURE__ */ jsxs(Flex, { align: "center", gap: "1", children: [
|
|
76
|
+
/* @__PURE__ */ jsx(TimerIcon, {}),
|
|
77
|
+
runningTime
|
|
78
|
+
] })
|
|
79
|
+
}
|
|
80
|
+
)
|
|
81
|
+
] }),
|
|
82
|
+
/* @__PURE__ */ jsx(Box, { style: { marginBottom: "auto" }, children: /* @__PURE__ */ jsx("ul", { style: { margin: 0, paddingLeft: 20 }, children: description == null ? void 0 : description.map((el) => {
|
|
83
|
+
return /* @__PURE__ */ jsx("li", { style: { marginBottom: 8 }, children: /* @__PURE__ */ jsx(Heading, { truncate: true, variant: "heading5", weight: "regular", children: el }) }, el);
|
|
84
|
+
}) }) }),
|
|
85
|
+
/* @__PURE__ */ jsx(Separator, { size: "4" }),
|
|
86
|
+
/* @__PURE__ */ jsxs(Flex, { align: "center", gap: "2", justify: "end", children: [
|
|
87
|
+
/* @__PURE__ */ jsx(Typo, { color: "gray", children: "\uAC15\uC758 \uB4E3\uACE0 \uCF54\uCE58\uB2D8\uACFC \uBB34\uC81C\uD55C Q&A" }),
|
|
88
|
+
/* @__PURE__ */ jsx(ArrowRightIcon, { color: "gray" })
|
|
89
|
+
] })
|
|
90
|
+
] })
|
|
91
|
+
]
|
|
92
|
+
}
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export {
|
|
97
|
+
CurriculumCard
|
|
98
|
+
};
|
|
99
|
+
//# sourceMappingURL=chunk-6PUQK6YK.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/app/platform/curriculum-card.tsx"],"sourcesContent":["import React from 'react';\nimport { Badge } from '@/atoms/badge';\nimport { Box } from '@/atoms/box';\nimport { Grid } from '@/atoms/grid';\nimport { Heading } from '@/atoms/heading';\nimport { Typo } from '@/atoms/typo';\nimport { Separator } from '@/atoms/separator';\nimport { Flex } from '@/atoms/flex';\nimport { ArrowRightIcon, TimerIcon } from '@/icon';\n\nexport interface CurriculumCardProps {\n title?: string;\n imgTitle?: string;\n imgSrc?: string;\n description?: string[];\n runningTime?: string;\n bgColor?: string;\n onClick?: () => void;\n}\n\nexport function CurriculumCard(props: CurriculumCardProps): React.ReactNode {\n const {\n title,\n imgTitle,\n imgSrc,\n description,\n runningTime,\n bgColor,\n onClick,\n } = props;\n return (\n <Grid\n columns={{ initial: '1', sm: '275px 1fr' }}\n gapX=\"5\"\n gapY=\"2\"\n onClick={onClick}\n style={{ cursor: 'pointer' }}\n >\n {/* 섬네일 */}\n <Box\n height=\"165px\"\n p=\"3\"\n style={{\n backgroundImage: `url(${imgSrc})`,\n backgroundColor: bgColor,\n backgroundPositionX: 'right',\n backgroundPositionY: 'bottom',\n backgroundRepeat: 'no-repeat',\n backgroundSize: 'contain',\n backgroundAttachment: 'local',\n }}\n width=\"100%\"\n >\n <Heading style={{ whiteSpace: 'break-spaces' }} variant=\"heading3\">\n {imgTitle}\n </Heading>\n </Box>\n {/* 텍스트 */}\n <Flex direction=\"column\" gap=\"3\">\n {/* 제목 */}\n <Grid columns={{ initial: '1', xs: '1fr auto' }} gapY=\"3\">\n <Heading variant=\"heading4\">{title}</Heading>\n <Badge\n size=\"medium\"\n style={{ justifySelf: 'flex-start' }}\n variant=\"outline\"\n >\n <Flex align=\"center\" gap=\"1\">\n <TimerIcon />\n {runningTime}\n </Flex>\n </Badge>\n </Grid>\n {/* 설명 */}\n <Box style={{ marginBottom: 'auto' }}>\n <ul style={{ margin: 0, paddingLeft: 20 }}>\n {description?.map((el) => {\n return (\n <li key={el} style={{ marginBottom: 8 }}>\n <Heading truncate variant=\"heading5\" weight=\"regular\">\n {el}\n </Heading>\n </li>\n );\n })}\n </ul>\n </Box>\n <Separator size=\"4\" />\n <Flex align=\"center\" gap=\"2\" justify=\"end\">\n <Typo color=\"gray\">강의 듣고 코치님과 무제한 Q&A</Typo>\n <ArrowRightIcon color=\"gray\" />\n </Flex>\n </Flex>\n </Grid>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAqDQ,cAcI,YAdJ;AAjCD,SAAS,eAAe,OAA6C;AAC1E,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AACJ,SACE;AAAA,IAAC;AAAA;AAAA,MACC,SAAS,EAAE,SAAS,KAAK,IAAI,YAAY;AAAA,MACzC,MAAK;AAAA,MACL,MAAK;AAAA,MACL;AAAA,MACA,OAAO,EAAE,QAAQ,UAAU;AAAA,MAG3B;AAAA;AAAA,UAAC;AAAA;AAAA,YACC,QAAO;AAAA,YACP,GAAE;AAAA,YACF,OAAO;AAAA,cACL,iBAAiB,OAAO,MAAM;AAAA,cAC9B,iBAAiB;AAAA,cACjB,qBAAqB;AAAA,cACrB,qBAAqB;AAAA,cACrB,kBAAkB;AAAA,cAClB,gBAAgB;AAAA,cAChB,sBAAsB;AAAA,YACxB;AAAA,YACA,OAAM;AAAA,YAEN,8BAAC,WAAQ,OAAO,EAAE,YAAY,eAAe,GAAG,SAAQ,YACrD,oBACH;AAAA;AAAA,QACF;AAAA,QAEA,qBAAC,QAAK,WAAU,UAAS,KAAI,KAE3B;AAAA,+BAAC,QAAK,SAAS,EAAE,SAAS,KAAK,IAAI,WAAW,GAAG,MAAK,KACpD;AAAA,gCAAC,WAAQ,SAAQ,YAAY,iBAAM;AAAA,YACnC;AAAA,cAAC;AAAA;AAAA,gBACC,MAAK;AAAA,gBACL,OAAO,EAAE,aAAa,aAAa;AAAA,gBACnC,SAAQ;AAAA,gBAER,+BAAC,QAAK,OAAM,UAAS,KAAI,KACvB;AAAA,sCAAC,aAAU;AAAA,kBACV;AAAA,mBACH;AAAA;AAAA,YACF;AAAA,aACF;AAAA,UAEA,oBAAC,OAAI,OAAO,EAAE,cAAc,OAAO,GACjC,8BAAC,QAAG,OAAO,EAAE,QAAQ,GAAG,aAAa,GAAG,GACrC,qDAAa,IAAI,CAAC,OAAO;AACxB,mBACE,oBAAC,QAAY,OAAO,EAAE,cAAc,EAAE,GACpC,8BAAC,WAAQ,UAAQ,MAAC,SAAQ,YAAW,QAAO,WACzC,cACH,KAHO,EAIT;AAAA,UAEJ,IACF,GACF;AAAA,UACA,oBAAC,aAAU,MAAK,KAAI;AAAA,UACpB,qBAAC,QAAK,OAAM,UAAS,KAAI,KAAI,SAAQ,OACnC;AAAA,gCAAC,QAAK,OAAM,QAAO,uFAAkB;AAAA,YACrC,oBAAC,kBAAe,OAAM,QAAO;AAAA,aAC/B;AAAA,WACF;AAAA;AAAA;AAAA,EACF;AAEJ;","names":[]}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import {
|
|
2
|
+
EditCoachingTime
|
|
3
|
+
} from "./chunk-DAGMEXFD.js";
|
|
4
|
+
import {
|
|
5
|
+
EditServiceType
|
|
6
|
+
} from "./chunk-5WQQYEQD.js";
|
|
7
|
+
import {
|
|
8
|
+
Grid
|
|
9
|
+
} from "./chunk-EGEQY3KT.js";
|
|
10
|
+
import {
|
|
11
|
+
DataList
|
|
12
|
+
} from "./chunk-VTJZMOSP.js";
|
|
13
|
+
import {
|
|
14
|
+
Dialog
|
|
15
|
+
} from "./chunk-U5DI2EGA.js";
|
|
16
|
+
import {
|
|
17
|
+
BulletText
|
|
18
|
+
} from "./chunk-QRI6ARS6.js";
|
|
19
|
+
import {
|
|
20
|
+
Flex
|
|
21
|
+
} from "./chunk-25HMMI7R.js";
|
|
22
|
+
import {
|
|
23
|
+
Button
|
|
24
|
+
} from "./chunk-ZVDAEY5Q.js";
|
|
25
|
+
import {
|
|
26
|
+
Card
|
|
27
|
+
} from "./chunk-RP2RGCAW.js";
|
|
28
|
+
import {
|
|
29
|
+
Pencil1Icon
|
|
30
|
+
} from "./chunk-R7IT4TCD.js";
|
|
31
|
+
import {
|
|
32
|
+
Heading
|
|
33
|
+
} from "./chunk-BESTU2AY.js";
|
|
34
|
+
import {
|
|
35
|
+
__objRest,
|
|
36
|
+
__spreadProps,
|
|
37
|
+
__spreadValues
|
|
38
|
+
} from "./chunk-CRTRMMJ7.js";
|
|
39
|
+
|
|
40
|
+
// src/app/platform/session-card.tsx
|
|
41
|
+
import { useCallback, useMemo } from "react";
|
|
42
|
+
import { format } from "date-fns";
|
|
43
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
44
|
+
var preventDefault = (e) => {
|
|
45
|
+
e.preventDefault();
|
|
46
|
+
};
|
|
47
|
+
function SessionCard(props) {
|
|
48
|
+
const _a = props, {
|
|
49
|
+
sessionNumber,
|
|
50
|
+
userName,
|
|
51
|
+
error,
|
|
52
|
+
ExtraButtons,
|
|
53
|
+
TitleExtra,
|
|
54
|
+
editable,
|
|
55
|
+
onSaveDate,
|
|
56
|
+
onSaveSessionType,
|
|
57
|
+
startAt,
|
|
58
|
+
endAt,
|
|
59
|
+
sessionType
|
|
60
|
+
} = _a, rest = __objRest(_a, [
|
|
61
|
+
"sessionNumber",
|
|
62
|
+
"userName",
|
|
63
|
+
"error",
|
|
64
|
+
"ExtraButtons",
|
|
65
|
+
"TitleExtra",
|
|
66
|
+
"editable",
|
|
67
|
+
"onSaveDate",
|
|
68
|
+
"onSaveSessionType",
|
|
69
|
+
"startAt",
|
|
70
|
+
"endAt",
|
|
71
|
+
"sessionType"
|
|
72
|
+
]);
|
|
73
|
+
const renderEditButton = useCallback(() => {
|
|
74
|
+
return /* @__PURE__ */ jsx(Button, { color: "gray", ml: "2", variant: "transparent", children: /* @__PURE__ */ jsx(Pencil1Icon, {}) });
|
|
75
|
+
}, []);
|
|
76
|
+
const sessionTimeStr = useMemo(() => {
|
|
77
|
+
if (!startAt || !endAt) return "\uC54C \uC218 \uC5C6\uC74C";
|
|
78
|
+
return `${format(startAt, "yyyy\uB144 MM\uC6D4 dd\uC77C HH\uC2DC mm\uBD84")} ~ ${format(endAt, "HH\uC2DC mm\uBD84")}`;
|
|
79
|
+
}, [startAt, endAt]);
|
|
80
|
+
return /* @__PURE__ */ jsx(Card, __spreadProps(__spreadValues({ error: Boolean(error) }, rest), { children: /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: "3", children: [
|
|
81
|
+
/* @__PURE__ */ jsxs(Flex, { align: "center", width: "100%", children: [
|
|
82
|
+
/* @__PURE__ */ jsx(Heading, { variant: "heading4", children: `${userName || "\uC54C \uC218 \uC5C6\uC74C"}\uB2D8 ${sessionNumber || "-"}\uD68C\uCC28` }),
|
|
83
|
+
TitleExtra,
|
|
84
|
+
error ? /* @__PURE__ */ jsx(BulletText, { as: "p", color: "red", variant: "caption", children: error }) : null
|
|
85
|
+
] }),
|
|
86
|
+
/* @__PURE__ */ jsxs(DataList.Root, { children: [
|
|
87
|
+
/* @__PURE__ */ jsxs(DataList.Item, { children: [
|
|
88
|
+
/* @__PURE__ */ jsx(DataList.Label, { children: "\uCF54\uCE6D \uC77C\uC2DC" }),
|
|
89
|
+
/* @__PURE__ */ jsxs(DataList.Value, { children: [
|
|
90
|
+
sessionTimeStr,
|
|
91
|
+
editable ? /* @__PURE__ */ jsxs(Dialog.Root, { children: [
|
|
92
|
+
/* @__PURE__ */ jsx(Dialog.Trigger, { children: renderEditButton() }),
|
|
93
|
+
/* @__PURE__ */ jsx(
|
|
94
|
+
Dialog.Content,
|
|
95
|
+
{
|
|
96
|
+
onOpenAutoFocus: preventDefault,
|
|
97
|
+
style: { overflow: "visible" },
|
|
98
|
+
title: `${sessionNumber}\uD68C\uCC28 \uC138\uC158 \uC77C\uC2DC \uBCC0\uACBD\uD558\uAE30`,
|
|
99
|
+
children: /* @__PURE__ */ jsx(
|
|
100
|
+
EditCoachingTime,
|
|
101
|
+
{
|
|
102
|
+
defaultEndAt: endAt,
|
|
103
|
+
defaultStartAt: startAt,
|
|
104
|
+
onClickSave: onSaveDate
|
|
105
|
+
}
|
|
106
|
+
)
|
|
107
|
+
}
|
|
108
|
+
)
|
|
109
|
+
] }) : null
|
|
110
|
+
] })
|
|
111
|
+
] }),
|
|
112
|
+
/* @__PURE__ */ jsxs(Grid, { columns: { initial: "1", xs: "2" }, style: { gap: "inherit" }, children: [
|
|
113
|
+
/* @__PURE__ */ jsxs(DataList.Item, { children: [
|
|
114
|
+
/* @__PURE__ */ jsx(DataList.Label, { children: "\uC138\uC158 \uCC38\uC5EC \uBC29\uC2DD" }),
|
|
115
|
+
/* @__PURE__ */ jsxs(DataList.Value, { children: [
|
|
116
|
+
sessionType === "offlineCoaching" ? "\uC624\uD504\uB77C\uC778" : "\uC628\uB77C\uC778",
|
|
117
|
+
editable ? /* @__PURE__ */ jsxs(Dialog.Root, { children: [
|
|
118
|
+
/* @__PURE__ */ jsx(Dialog.Trigger, { children: renderEditButton() }),
|
|
119
|
+
/* @__PURE__ */ jsx(
|
|
120
|
+
Dialog.Content,
|
|
121
|
+
{
|
|
122
|
+
title: `${sessionNumber}\uD68C\uCC28 \uC138\uC158 \uC9C4\uD589 \uBC29\uC2DD \uBCC0\uACBD\uD558\uAE30`,
|
|
123
|
+
children: /* @__PURE__ */ jsx(
|
|
124
|
+
EditServiceType,
|
|
125
|
+
{
|
|
126
|
+
defaultServiceType: sessionType,
|
|
127
|
+
onClickSave: onSaveSessionType
|
|
128
|
+
}
|
|
129
|
+
)
|
|
130
|
+
}
|
|
131
|
+
)
|
|
132
|
+
] }) : null
|
|
133
|
+
] })
|
|
134
|
+
] }),
|
|
135
|
+
/* @__PURE__ */ jsx(Flex, { gap: "2", justify: "end", children: ExtraButtons })
|
|
136
|
+
] })
|
|
137
|
+
] })
|
|
138
|
+
] }) }));
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
export {
|
|
142
|
+
SessionCard
|
|
143
|
+
};
|
|
144
|
+
//# sourceMappingURL=chunk-7YI6WBLJ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/app/platform/session-card.tsx"],"sourcesContent":["import React, { useCallback, useMemo } from 'react';\nimport { format } from 'date-fns';\nimport type { ServiceType } from '@/types/biz.type';\nimport type { CardProps } from '../../atoms';\nimport {\n BulletText,\n Button,\n Card,\n DataList,\n Dialog,\n Flex,\n Grid,\n Heading,\n} from '../../atoms';\nimport { Pencil1Icon } from '../../icon';\nimport { EditCoachingTime } from './edit-coaching-time';\nimport { EditServiceType } from './edit-service-type';\n\nconst preventDefault = (e: Event): void => {\n e.preventDefault();\n};\nexport type SessionCardProps = Omit<CardProps, 'error'> & {\n error?: string;\n startAt?: Date;\n endAt?: Date;\n sessionType?: ServiceType;\n userName?: string;\n sessionNumber?: number;\n ExtraButtons?: React.ReactNode;\n editable?: boolean;\n TitleExtra?: React.ReactNode;\n onSaveDate?: (startTime: Date, endTime: Date) => void;\n onSaveSessionType?: (sessionType: string) => void;\n};\n\nexport function SessionCard(props: SessionCardProps): React.ReactNode {\n const {\n sessionNumber,\n userName,\n error,\n ExtraButtons,\n TitleExtra,\n editable,\n onSaveDate,\n onSaveSessionType,\n startAt,\n endAt,\n sessionType,\n ...rest\n } = props;\n\n const renderEditButton = useCallback((): React.ReactNode => {\n return (\n <Button color=\"gray\" ml=\"2\" variant=\"transparent\">\n <Pencil1Icon />\n </Button>\n );\n }, []);\n\n const sessionTimeStr = useMemo(() => {\n if (!startAt || !endAt) return '알 수 없음';\n\n return `${format(startAt, 'yyyy년 MM월 dd일 HH시 mm분')} ~ ${format(endAt, 'HH시 mm분')}`;\n }, [startAt, endAt]);\n\n return (\n <Card error={Boolean(error)} {...rest}>\n <Flex direction=\"column\" gap=\"3\">\n <Flex align=\"center\" width=\"100%\">\n <Heading variant=\"heading4\">\n {`${userName || '알 수 없음'}님 ${sessionNumber || '-'}회차`}\n </Heading>\n {TitleExtra}\n {error ? (\n <BulletText as=\"p\" color=\"red\" variant=\"caption\">\n {error}\n </BulletText>\n ) : null}\n </Flex>\n <DataList.Root>\n <DataList.Item>\n <DataList.Label>코칭 일시</DataList.Label>\n <DataList.Value>\n {sessionTimeStr}\n {editable ? (\n <Dialog.Root>\n <Dialog.Trigger>{renderEditButton()}</Dialog.Trigger>\n <Dialog.Content\n onOpenAutoFocus={preventDefault}\n style={{ overflow: 'visible' }}\n title={`${sessionNumber}회차 세션 일시 변경하기`}\n >\n <EditCoachingTime\n defaultEndAt={endAt}\n defaultStartAt={startAt}\n onClickSave={onSaveDate}\n />\n </Dialog.Content>\n </Dialog.Root>\n ) : null}\n </DataList.Value>\n </DataList.Item>\n <Grid columns={{ initial: '1', xs: '2' }} style={{ gap: 'inherit' }}>\n <DataList.Item>\n <DataList.Label>세션 참여 방식</DataList.Label>\n <DataList.Value>\n {sessionType === 'offlineCoaching' ? '오프라인' : '온라인'}\n {editable ? (\n <Dialog.Root>\n <Dialog.Trigger>{renderEditButton()}</Dialog.Trigger>\n <Dialog.Content\n title={`${sessionNumber}회차 세션 진행 방식 변경하기`}\n >\n <EditServiceType\n defaultServiceType={sessionType}\n onClickSave={onSaveSessionType}\n />\n </Dialog.Content>\n </Dialog.Root>\n ) : null}\n </DataList.Value>\n </DataList.Item>\n\n <Flex gap=\"2\" justify=\"end\">\n {ExtraButtons}\n </Flex>\n </Grid>\n </DataList.Root>\n </Flex>\n </Card>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAgB,aAAa,eAAe;AAC5C,SAAS,cAAc;AAqDf,cAcA,YAdA;AApCR,IAAM,iBAAiB,CAAC,MAAmB;AACzC,IAAE,eAAe;AACnB;AAeO,SAAS,YAAY,OAA0C;AACpE,QAaI,YAZF;AAAA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EA/CJ,IAiDM,IADC,iBACD,IADC;AAAA,IAXH;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAIF,QAAM,mBAAmB,YAAY,MAAuB;AAC1D,WACE,oBAAC,UAAO,OAAM,QAAO,IAAG,KAAI,SAAQ,eAClC,8BAAC,eAAY,GACf;AAAA,EAEJ,GAAG,CAAC,CAAC;AAEL,QAAM,iBAAiB,QAAQ,MAAM;AACnC,QAAI,CAAC,WAAW,CAAC,MAAO,QAAO;AAE/B,WAAO,GAAG,OAAO,SAAS,gDAAuB,CAAC,MAAM,OAAO,OAAO,mBAAS,CAAC;AAAA,EAClF,GAAG,CAAC,SAAS,KAAK,CAAC;AAEnB,SACE,oBAAC,qCAAK,OAAO,QAAQ,KAAK,KAAO,OAAhC,EACC,+BAAC,QAAK,WAAU,UAAS,KAAI,KAC3B;AAAA,yBAAC,QAAK,OAAM,UAAS,OAAM,QACzB;AAAA,0BAAC,WAAQ,SAAQ,YACd,aAAG,YAAY,4BAAQ,UAAK,iBAAiB,GAAG,gBACnD;AAAA,MACC;AAAA,MACA,QACC,oBAAC,cAAW,IAAG,KAAI,OAAM,OAAM,SAAQ,WACpC,iBACH,IACE;AAAA,OACN;AAAA,IACA,qBAAC,SAAS,MAAT,EACC;AAAA,2BAAC,SAAS,MAAT,EACC;AAAA,4BAAC,SAAS,OAAT,EAAe,uCAAK;AAAA,QACrB,qBAAC,SAAS,OAAT,EACE;AAAA;AAAA,UACA,WACC,qBAAC,OAAO,MAAP,EACC;AAAA,gCAAC,OAAO,SAAP,EAAgB,2BAAiB,GAAE;AAAA,YACpC;AAAA,cAAC,OAAO;AAAA,cAAP;AAAA,gBACC,iBAAiB;AAAA,gBACjB,OAAO,EAAE,UAAU,UAAU;AAAA,gBAC7B,OAAO,GAAG,aAAa;AAAA,gBAEvB;AAAA,kBAAC;AAAA;AAAA,oBACC,cAAc;AAAA,oBACd,gBAAgB;AAAA,oBAChB,aAAa;AAAA;AAAA,gBACf;AAAA;AAAA,YACF;AAAA,aACF,IACE;AAAA,WACN;AAAA,SACF;AAAA,MACA,qBAAC,QAAK,SAAS,EAAE,SAAS,KAAK,IAAI,IAAI,GAAG,OAAO,EAAE,KAAK,UAAU,GAChE;AAAA,6BAAC,SAAS,MAAT,EACC;AAAA,8BAAC,SAAS,OAAT,EAAe,oDAAQ;AAAA,UACxB,qBAAC,SAAS,OAAT,EACE;AAAA,4BAAgB,oBAAoB,6BAAS;AAAA,YAC7C,WACC,qBAAC,OAAO,MAAP,EACC;AAAA,kCAAC,OAAO,SAAP,EAAgB,2BAAiB,GAAE;AAAA,cACpC;AAAA,gBAAC,OAAO;AAAA,gBAAP;AAAA,kBACC,OAAO,GAAG,aAAa;AAAA,kBAEvB;AAAA,oBAAC;AAAA;AAAA,sBACC,oBAAoB;AAAA,sBACpB,aAAa;AAAA;AAAA,kBACf;AAAA;AAAA,cACF;AAAA,eACF,IACE;AAAA,aACN;AAAA,WACF;AAAA,QAEA,oBAAC,QAAK,KAAI,KAAI,SAAQ,OACnB,wBACH;AAAA,SACF;AAAA,OACF;AAAA,KACF,IACF;AAEJ;","names":[]}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import {
|
|
2
|
+
review_question_satisfaction_option_default
|
|
3
|
+
} from "./chunk-BUZDDAS6.js";
|
|
4
|
+
import {
|
|
5
|
+
ReviewQuestionSatisfisText
|
|
6
|
+
} from "./chunk-BZJSMPS7.js";
|
|
7
|
+
import {
|
|
8
|
+
review_question_text_default
|
|
9
|
+
} from "./chunk-Z42FOTXC.js";
|
|
10
|
+
import {
|
|
11
|
+
review_question_radio_default
|
|
12
|
+
} from "./chunk-WHZZKXOD.js";
|
|
13
|
+
|
|
14
|
+
// src/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/ReviewQuestion/review-question-body.tsx
|
|
15
|
+
import { jsx } from "react/jsx-runtime";
|
|
16
|
+
function ReviewQuestionBody(props) {
|
|
17
|
+
const { question, answer, error, onChange } = props;
|
|
18
|
+
if (question.type === "question_radio") {
|
|
19
|
+
return /* @__PURE__ */ jsx(
|
|
20
|
+
review_question_radio_default,
|
|
21
|
+
{
|
|
22
|
+
answer,
|
|
23
|
+
error,
|
|
24
|
+
onChange,
|
|
25
|
+
question
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
if (question.type === "question_text") {
|
|
30
|
+
return /* @__PURE__ */ jsx(
|
|
31
|
+
review_question_text_default,
|
|
32
|
+
{
|
|
33
|
+
answer,
|
|
34
|
+
error,
|
|
35
|
+
onChange,
|
|
36
|
+
question
|
|
37
|
+
}
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
if (question.type === "question_satisfaction_option") {
|
|
41
|
+
return /* @__PURE__ */ jsx(
|
|
42
|
+
review_question_satisfaction_option_default,
|
|
43
|
+
{
|
|
44
|
+
answer,
|
|
45
|
+
error,
|
|
46
|
+
onChange,
|
|
47
|
+
question
|
|
48
|
+
}
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
if (question.type === "question_satisfaction_text") {
|
|
52
|
+
return /* @__PURE__ */ jsx(
|
|
53
|
+
ReviewQuestionSatisfisText,
|
|
54
|
+
{
|
|
55
|
+
answer,
|
|
56
|
+
error,
|
|
57
|
+
onChange,
|
|
58
|
+
question
|
|
59
|
+
}
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
|
+
var review_question_body_default = ReviewQuestionBody;
|
|
65
|
+
|
|
66
|
+
export {
|
|
67
|
+
review_question_body_default
|
|
68
|
+
};
|
|
69
|
+
//# sourceMappingURL=chunk-AYAO3MO4.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/ReviewQuestion/review-question-body.tsx"],"sourcesContent":["import React from 'react'; \nimport type { ReviewQuestionElement } from '@/types/curriculum.type';\nimport ReviewQuestionRadio from './review-question-radio';\nimport ReviewQuestionText from './review-question-text';\nimport ReviewQuestionSatisfactionOption from './review-question-satisfaction-option';\nimport ReviewQuestionSatisfactionText from './review-question-satisfaction-text';\n\ninterface ReviewQuestionBodyProps {\n question: ReviewQuestionElement;\n answer: string;\n error?: string;\n onChange: (value: string) => void;\n}\n\nfunction ReviewQuestionBody(props: ReviewQuestionBodyProps): React.ReactNode {\n const { question, answer, error, onChange } = props;\n \n if (question.type === 'question_radio') {\n return (\n <ReviewQuestionRadio\n answer={answer}\n error={error}\n onChange={onChange}\n question={question}\n />\n );\n }\n if (question.type === 'question_text') {\n return (\n <ReviewQuestionText\n answer={answer}\n error={error}\n onChange={onChange}\n question={question}\n />\n );\n }\n if (question.type === 'question_satisfaction_option') {\n return (\n <ReviewQuestionSatisfactionOption\n answer={answer}\n error={error}\n onChange={onChange}\n question={question}\n />\n );\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- 그 외의 타입이 있을 경우 있음\n if (question.type === 'question_satisfaction_text') {\n return (\n <ReviewQuestionSatisfactionText\n answer={answer}\n error={error}\n onChange={onChange}\n question={question}\n />\n );\n }\n\n return null;\n}\nexport default ReviewQuestionBody;\n"],"mappings":";;;;;;;;;;;;;;AAmBM;AALN,SAAS,mBAAmB,OAAiD;AAC3E,QAAM,EAAE,UAAU,QAAQ,OAAO,SAAS,IAAI;AAE9C,MAAI,SAAS,SAAS,kBAAkB;AACtC,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA;AAAA,IACF;AAAA,EAEJ;AACA,MAAI,SAAS,SAAS,iBAAiB;AACrC,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA;AAAA,IACF;AAAA,EAEJ;AACA,MAAI,SAAS,SAAS,gCAAgC;AACpD,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA;AAAA,IACF;AAAA,EAEJ;AAGA,MAAI,SAAS,SAAS,8BAA8B;AAClD,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA;AAAA,IACF;AAAA,EAEJ;AAEA,SAAO;AACT;AACA,IAAO,+BAAQ;","names":[]}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useCurriculumContext
|
|
3
|
+
} from "./chunk-IYQJIEVM.js";
|
|
4
|
+
import {
|
|
5
|
+
Grid
|
|
6
|
+
} from "./chunk-EGEQY3KT.js";
|
|
7
|
+
import {
|
|
8
|
+
IconButton
|
|
9
|
+
} from "./chunk-XK6VEVOK.js";
|
|
10
|
+
import {
|
|
11
|
+
Box
|
|
12
|
+
} from "./chunk-4Y5BEXVN.js";
|
|
13
|
+
import {
|
|
14
|
+
ChevronLeftIcon,
|
|
15
|
+
ChevronRightIcon
|
|
16
|
+
} from "./chunk-R7IT4TCD.js";
|
|
17
|
+
import {
|
|
18
|
+
Heading
|
|
19
|
+
} from "./chunk-BESTU2AY.js";
|
|
20
|
+
import {
|
|
21
|
+
Typo
|
|
22
|
+
} from "./chunk-PMJIFLDT.js";
|
|
23
|
+
|
|
24
|
+
// src/molecules/curriculumV2/curriculum-sub-nav.tsx
|
|
25
|
+
import { useCallback } from "react";
|
|
26
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
27
|
+
function CurriculumSubNav() {
|
|
28
|
+
const {
|
|
29
|
+
selectedItem,
|
|
30
|
+
selectedSectionTitle,
|
|
31
|
+
hasPrev,
|
|
32
|
+
hasNext,
|
|
33
|
+
selectPrev,
|
|
34
|
+
selectNext,
|
|
35
|
+
scrollNavItem
|
|
36
|
+
} = useCurriculumContext();
|
|
37
|
+
const onClickPrev = useCallback(() => {
|
|
38
|
+
selectPrev((moveIndex) => {
|
|
39
|
+
scrollNavItem(moveIndex.toString());
|
|
40
|
+
});
|
|
41
|
+
}, [selectPrev, scrollNavItem]);
|
|
42
|
+
const onClickNext = useCallback(() => {
|
|
43
|
+
selectNext((moveIndex) => {
|
|
44
|
+
scrollNavItem(moveIndex.toString());
|
|
45
|
+
});
|
|
46
|
+
}, [selectNext, scrollNavItem]);
|
|
47
|
+
return /* @__PURE__ */ jsxs(
|
|
48
|
+
Grid,
|
|
49
|
+
{
|
|
50
|
+
align: "center",
|
|
51
|
+
columns: { initial: "32px 1fr 32px", md: "48px 1fr 48px" },
|
|
52
|
+
pb: { initial: "2", md: "3" },
|
|
53
|
+
px: { initial: "1", md: "2" },
|
|
54
|
+
py: "2",
|
|
55
|
+
rows: "auto",
|
|
56
|
+
children: [
|
|
57
|
+
hasPrev ? /* @__PURE__ */ jsx(
|
|
58
|
+
IconButton,
|
|
59
|
+
{
|
|
60
|
+
color: "gray",
|
|
61
|
+
onClick: onClickPrev,
|
|
62
|
+
size: { initial: "medium", md: "large" },
|
|
63
|
+
variant: "ghost",
|
|
64
|
+
children: /* @__PURE__ */ jsx(ChevronLeftIcon, { height: "16px", width: "16px" })
|
|
65
|
+
}
|
|
66
|
+
) : /* @__PURE__ */ jsx(Box, {}),
|
|
67
|
+
/* @__PURE__ */ jsxs(Box, { width: "100%", children: [
|
|
68
|
+
/* @__PURE__ */ jsx(Box, { display: { initial: "none", md: "block" }, children: /* @__PURE__ */ jsx(Heading, { style: { textOverflow: "ellipsis" }, variant: "heading5", children: selectedItem.title }) }),
|
|
69
|
+
/* @__PURE__ */ jsx(Box, { display: { initial: "block", md: "none" }, children: /* @__PURE__ */ jsx(Typo, { weight: "bold", children: selectedItem.title }) }),
|
|
70
|
+
/* @__PURE__ */ jsx(
|
|
71
|
+
Typo,
|
|
72
|
+
{
|
|
73
|
+
as: "p",
|
|
74
|
+
color: "gray",
|
|
75
|
+
mt: "1",
|
|
76
|
+
style: { textOverflow: "ellipsis" },
|
|
77
|
+
variant: "caption",
|
|
78
|
+
children: selectedSectionTitle == null ? void 0 : selectedSectionTitle.title
|
|
79
|
+
}
|
|
80
|
+
)
|
|
81
|
+
] }),
|
|
82
|
+
hasNext ? /* @__PURE__ */ jsx(
|
|
83
|
+
IconButton,
|
|
84
|
+
{
|
|
85
|
+
color: "gray",
|
|
86
|
+
onClick: onClickNext,
|
|
87
|
+
size: { initial: "medium", md: "large" },
|
|
88
|
+
variant: "ghost",
|
|
89
|
+
children: /* @__PURE__ */ jsx(ChevronRightIcon, { height: "16px", width: "16px" })
|
|
90
|
+
}
|
|
91
|
+
) : /* @__PURE__ */ jsx(Box, {})
|
|
92
|
+
]
|
|
93
|
+
}
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export {
|
|
98
|
+
CurriculumSubNav
|
|
99
|
+
};
|
|
100
|
+
//# sourceMappingURL=chunk-BW2VENFR.js.map
|