Skip to content

Commit

Permalink
fix: #330 질문 개수 제한 토스트 반영
Browse files Browse the repository at this point in the history
  • Loading branch information
leeminhee119 committed Sep 11, 2024
1 parent 8a6803d commit 610b391
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,17 @@ export function AddQuestionsBottomSheet({ onClose, handleAddQuestions, maxCount
overflow: auto;
`}
>
<CheckBoxGroup isChecked={isChecked} onChange={toggle} gap={4}>
<CheckBoxGroup
isChecked={isChecked}
onChange={(value) => {
if (!isChecked(value) && selectedValues.length >= maxCount) {
toast.error("추가 가능한 질문 개수를 초과했어요");
return;
}
toggle(value);
}}
gap={4}
>
{RECOMMENDED_QUESTIONS[curCategoryTab].map((question, index) => {
return (
<QuestionItemCheckbox value={question} key={index}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ export function EditQuestions({ goNext, goPrev }: EditQuestionsProps) {
};

const onNext = () => {
if (newQuestions.length === 0) {
toast.error("최소 1개 이상의 질문으로 구성해주세요");
return;
}
saveData();
goNext();
};
Expand Down

0 comments on commit 610b391

Please sign in to comment.