From 8760647c8285fb6883ec92a71c6c9d0a25bf24e4 Mon Sep 17 00:00:00 2001 From: yumin-kim4757 Date: Thu, 16 Jul 2026 04:43:48 +0900 Subject: [PATCH 1/4] =?UTF-8?q?fix(web):=20=EC=84=A4=EC=A0=95=20=ED=83=9C?= =?UTF-8?q?=EA=B7=B8=20=EC=83=9D=EC=84=B1=20=EA=B0=9C=EC=88=98=20=EC=A0=9C?= =?UTF-8?q?=ED=95=9C=20=EC=B6=94=EA=B0=80=20(#242)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../account/SettingsProfileContainer.tsx | 18 ++++++++++++++++++ .../account/SettingsTagsSectionContainer.tsx | 18 ++++++++++++------ .../_hooks/account/use-settings-profile.ts | 9 +++++++++ apps/timo-web/messages/en.json | 1 + apps/timo-web/messages/ko.json | 1 + 5 files changed, 41 insertions(+), 6 deletions(-) diff --git a/apps/timo-web/app/[locale]/(main)/settings/_containers/account/SettingsProfileContainer.tsx b/apps/timo-web/app/[locale]/(main)/settings/_containers/account/SettingsProfileContainer.tsx index 8e1f8d8c..b4eaedb6 100644 --- a/apps/timo-web/app/[locale]/(main)/settings/_containers/account/SettingsProfileContainer.tsx +++ b/apps/timo-web/app/[locale]/(main)/settings/_containers/account/SettingsProfileContainer.tsx @@ -10,6 +10,8 @@ import { useSettingsProfileLabels } from "@/app/[locale]/(main)/settings/_hooks/ import { CreateTagModalContainer } from "@/components/tag/CreateTagModalContainer"; import { AnimatedToast } from "@/components/toast/AnimatedToast"; +const MAX_SETTING_CUSTOM_TAG_COUNT = 4; + export const SettingsProfileContainer = () => { const tToast = useTranslations("Toast"); @@ -20,6 +22,7 @@ export const SettingsProfileContainer = () => { profileState.calendarConnected, ); const [isTagErrorToastOpen, setIsTagErrorToastOpen] = useState(false); + const [isTagLimitToastOpen, setIsTagLimitToastOpen] = useState(false); const [isLanguageErrorToastOpen, setIsLanguageErrorToastOpen] = useState(false); @@ -37,6 +40,15 @@ export const SettingsProfileContainer = () => { }; const handleAddTag = () => { + const customTagCount = profileState.tags.filter( + (tag) => !tag.isDefault, + ).length; + + if (customTagCount >= MAX_SETTING_CUSTOM_TAG_COUNT) { + setIsTagLimitToastOpen(true); + return; + } + const existingLabels = profileState.tags.map((tag) => tag.label); overlay.open(({ isOpen, close, unmount }) => ( @@ -78,6 +90,12 @@ export const SettingsProfileContainer = () => { onLogout={profileActions.onLogout} /> + setIsTagLimitToastOpen(false)} + message={tToast("settingTagLimit")} + /> + setIsTagErrorToastOpen(false)} diff --git a/apps/timo-web/app/[locale]/(main)/settings/_containers/account/SettingsTagsSectionContainer.tsx b/apps/timo-web/app/[locale]/(main)/settings/_containers/account/SettingsTagsSectionContainer.tsx index 75102d01..bf2cacaa 100644 --- a/apps/timo-web/app/[locale]/(main)/settings/_containers/account/SettingsTagsSectionContainer.tsx +++ b/apps/timo-web/app/[locale]/(main)/settings/_containers/account/SettingsTagsSectionContainer.tsx @@ -11,6 +11,8 @@ import type { SettingsTagItem, } from "@/app/[locale]/(main)/settings/_types/account/profile-type"; +const MAX_SETTING_CUSTOM_TAG_COUNT = 4; + export interface SettingsTagsSectionContainerProps { tags: SettingsTagItem[]; labels: SettingsProfileLabels; @@ -26,6 +28,8 @@ export const SettingsTagsSectionContainer = ({ }: SettingsTagsSectionContainerProps) => { const [pendingTagId, setPendingTagId] = useState(null); const modalTriggerRef = useRef(null); + const canAddTag = + tags.filter((tag) => !tag.isDefault).length < MAX_SETTING_CUSTOM_TAG_COUNT; const handleRequestRemoveTag = (tagId: number) => { setPendingTagId(tagId); @@ -55,12 +59,14 @@ export const SettingsTagsSectionContainer = ({ ))} - } - onClick={onAddTag} - > - {labels.addTag} - + {canAddTag && ( + } + onClick={onAddTag} + > + {labels.addTag} + + )} void; } @@ -87,6 +89,13 @@ export const useSettingsProfile = () => { }; const handleCreateTag = (label: string, handlers: CreateTagHandlers) => { + const customTagCount = tagItems.filter((tag) => !tag.isDefault).length; + + if (customTagCount >= MAX_SETTING_CUSTOM_TAG_COUNT) { + handlers.onError(); + return; + } + createTag( { name: label }, { diff --git a/apps/timo-web/messages/en.json b/apps/timo-web/messages/en.json index c9e1afcd..90d61af3 100644 --- a/apps/timo-web/messages/en.json +++ b/apps/timo-web/messages/en.json @@ -153,6 +153,7 @@ "aiDurationRecommendFailed": "Failed to get the AI duration recommendation. Please try again.", "tagCreateFailed": "Failed to create the tag. Please try again.", "tagActionFailed": "Failed to update the tag. Please try again.", + "settingTagLimit": "You can create up to 4 setting tags.", "focusActionFailed": "Failed to process the request. Please try again.", "languageChangeFailed": "Failed to change the language. Please try again.", "timerAlreadyRunning": "Another to-do's timer is already running. Please stop it first.", diff --git a/apps/timo-web/messages/ko.json b/apps/timo-web/messages/ko.json index 0e8040b4..6a4b42a5 100644 --- a/apps/timo-web/messages/ko.json +++ b/apps/timo-web/messages/ko.json @@ -153,6 +153,7 @@ "aiDurationRecommendFailed": "AI 추천 소요 시간을 가져오지 못했어요. 다시 시도해 주세요.", "tagCreateFailed": "태그 생성에 실패했어요. 다시 시도해 주세요.", "tagActionFailed": "태그 처리에 실패했어요. 다시 시도해 주세요.", + "settingTagLimit": "설정 태그는 최대 4개까지 생성할 수 있어요.", "focusActionFailed": "요청을 처리하지 못했어요. 다시 시도해 주세요.", "languageChangeFailed": "언어 변경에 실패했어요. 다시 시도해 주세요.", "timerAlreadyRunning": "다른 투두의 타이머가 이미 실행 중이에요. 먼저 종료해 주세요.", From 79ce13573e0cad7b68d888c5032d436924a995fd Mon Sep 17 00:00:00 2001 From: yumin-kim4757 Date: Thu, 16 Jul 2026 12:59:30 +0900 Subject: [PATCH 2/4] =?UTF-8?q?fix(web):=20=EC=84=A4=EC=A0=95=20=ED=83=9C?= =?UTF-8?q?=EA=B7=B8=20=EC=83=9D=EC=84=B1=20=EA=B0=9C=EC=88=98=20=EC=A0=9C?= =?UTF-8?q?=ED=95=9C=20=EC=B6=94=EA=B0=80=20(#242)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../toast/TagLimitToastContainer.tsx | 18 ++++++++++++++++-- .../account/SettingsProfileContainer.tsx | 12 +++++++----- .../account/SettingsTagsSectionContainer.tsx | 18 ++++++------------ .../create/CreateTodoModalContent.tsx | 1 + .../detail/DetailTodoModalContent.tsx | 1 + apps/timo-web/messages/en.json | 3 +-- apps/timo-web/messages/ko.json | 3 +-- 7 files changed, 33 insertions(+), 23 deletions(-) diff --git a/apps/timo-web/app/[locale]/(main)/(with-time-sidebar)/home/_containers/toast/TagLimitToastContainer.tsx b/apps/timo-web/app/[locale]/(main)/(with-time-sidebar)/home/_containers/toast/TagLimitToastContainer.tsx index e83a64d1..47e1a9ad 100644 --- a/apps/timo-web/app/[locale]/(main)/(with-time-sidebar)/home/_containers/toast/TagLimitToastContainer.tsx +++ b/apps/timo-web/app/[locale]/(main)/(with-time-sidebar)/home/_containers/toast/TagLimitToastContainer.tsx @@ -4,17 +4,31 @@ import { useState } from "react"; import { AnimatedToast } from "@/components/toast/AnimatedToast"; -export const TagLimitToastContainer = () => { +interface TagLimitToastContainerProps { + count?: number; + onClose?: () => void; +} + +export const TagLimitToastContainer = ({ + count = 8, + onClose, +}: TagLimitToastContainerProps) => { const [isOpen, setIsOpen] = useState(true); const t = useTranslations("Toast"); + const handleClose = () => { + setIsOpen(false); + onClose?.(); + }; + return ( setIsOpen(false)} + onClose={handleClose} message={

{t.rich("tagLimit", { + count, blue: (chunks) => ( {chunks} ), diff --git a/apps/timo-web/app/[locale]/(main)/settings/_containers/account/SettingsProfileContainer.tsx b/apps/timo-web/app/[locale]/(main)/settings/_containers/account/SettingsProfileContainer.tsx index b4eaedb6..9cd1c3a1 100644 --- a/apps/timo-web/app/[locale]/(main)/settings/_containers/account/SettingsProfileContainer.tsx +++ b/apps/timo-web/app/[locale]/(main)/settings/_containers/account/SettingsProfileContainer.tsx @@ -4,6 +4,7 @@ import { useTranslations } from "next-intl"; import { overlay } from "overlay-kit"; import { useState } from "react"; +import { TagLimitToastContainer } from "@/app/[locale]/(main)/(with-time-sidebar)/home/_containers/toast/TagLimitToastContainer"; import { SettingsProfileView } from "@/app/[locale]/(main)/settings/_components/account/SettingsProfileView"; import { useSettingsProfile } from "@/app/[locale]/(main)/settings/_hooks/account/use-settings-profile"; import { useSettingsProfileLabels } from "@/app/[locale]/(main)/settings/_hooks/account/use-settings-profile-labels"; @@ -90,11 +91,12 @@ export const SettingsProfileContainer = () => { onLogout={profileActions.onLogout} /> - setIsTagLimitToastOpen(false)} - message={tToast("settingTagLimit")} - /> + {isTagLimitToastOpen && ( + setIsTagLimitToastOpen(false)} + /> + )} { const [pendingTagId, setPendingTagId] = useState(null); const modalTriggerRef = useRef(null); - const canAddTag = - tags.filter((tag) => !tag.isDefault).length < MAX_SETTING_CUSTOM_TAG_COUNT; const handleRequestRemoveTag = (tagId: number) => { setPendingTagId(tagId); @@ -59,14 +55,12 @@ export const SettingsTagsSectionContainer = ({ ))} - {canAddTag && ( - } - onClick={onAddTag} - > - {labels.addTag} - - )} + } + onClick={onAddTag} + > + {labels.addTag} + {tToast.rich("tagLimit", { + count: 8, blue: (chunks) => ( {chunks} ), diff --git a/apps/timo-web/components/todo-modal/detail/DetailTodoModalContent.tsx b/apps/timo-web/components/todo-modal/detail/DetailTodoModalContent.tsx index 280f4217..d0e7b7a0 100644 --- a/apps/timo-web/components/todo-modal/detail/DetailTodoModalContent.tsx +++ b/apps/timo-web/components/todo-modal/detail/DetailTodoModalContent.tsx @@ -298,6 +298,7 @@ export const DetailTodoModalContent = ({ message={

{tToast.rich("tagLimit", { + count: 8, blue: (chunks) => ( {chunks} ), diff --git a/apps/timo-web/messages/en.json b/apps/timo-web/messages/en.json index 90d61af3..56f04429 100644 --- a/apps/timo-web/messages/en.json +++ b/apps/timo-web/messages/en.json @@ -144,7 +144,7 @@ } }, "Toast": { - "tagLimit": "You can create up to 8 tags, and to add more, please delete existing tags.", + "tagLimit": "You can create up to {count} tags, and to add more, please delete existing tags.", "todoLimitLine1": "You can add up to 20 to-dos per day.", "todoLimitLine2": "To add a new to-do, please delete an existing one.", "onboardingSubmitFailed": "Failed to save onboarding. Please try again.", @@ -153,7 +153,6 @@ "aiDurationRecommendFailed": "Failed to get the AI duration recommendation. Please try again.", "tagCreateFailed": "Failed to create the tag. Please try again.", "tagActionFailed": "Failed to update the tag. Please try again.", - "settingTagLimit": "You can create up to 4 setting tags.", "focusActionFailed": "Failed to process the request. Please try again.", "languageChangeFailed": "Failed to change the language. Please try again.", "timerAlreadyRunning": "Another to-do's timer is already running. Please stop it first.", diff --git a/apps/timo-web/messages/ko.json b/apps/timo-web/messages/ko.json index 6a4b42a5..0e82016e 100644 --- a/apps/timo-web/messages/ko.json +++ b/apps/timo-web/messages/ko.json @@ -144,7 +144,7 @@ } }, "Toast": { - "tagLimit": "태그는 최대 8개까지 만들 수 있으며, 추가하려면 기존 태그를 삭제해 주세요.", + "tagLimit": "태그는 최대 {count}개까지 만들 수 있으며, 추가하려면 기존 태그를 삭제해 주세요.", "todoLimitLine1": "투두는 하루에 최대 20개까지 추가할 수 있어요.", "todoLimitLine2": "새로운 투두를 추가하려면 기존 투두를 삭제해주세요.", "onboardingSubmitFailed": "온보딩 저장에 실패했어요. 다시 시도해 주세요.", @@ -153,7 +153,6 @@ "aiDurationRecommendFailed": "AI 추천 소요 시간을 가져오지 못했어요. 다시 시도해 주세요.", "tagCreateFailed": "태그 생성에 실패했어요. 다시 시도해 주세요.", "tagActionFailed": "태그 처리에 실패했어요. 다시 시도해 주세요.", - "settingTagLimit": "설정 태그는 최대 4개까지 생성할 수 있어요.", "focusActionFailed": "요청을 처리하지 못했어요. 다시 시도해 주세요.", "languageChangeFailed": "언어 변경에 실패했어요. 다시 시도해 주세요.", "timerAlreadyRunning": "다른 투두의 타이머가 이미 실행 중이에요. 먼저 종료해 주세요.", From 920ef0d12d66f3c707a3cdf858434e4f5e7833b2 Mon Sep 17 00:00:00 2001 From: yumin-kim4757 Date: Thu, 16 Jul 2026 13:03:28 +0900 Subject: [PATCH 3/4] =?UTF-8?q?refactor(web):=20=EC=84=A4=EC=A0=95=20?= =?UTF-8?q?=ED=83=9C=EA=B7=B8=20=EC=A0=9C=ED=95=9C=20=EC=83=81=EC=88=98=20?= =?UTF-8?q?=EC=A4=91=EB=B3=B5=20=EC=A0=9C=EA=B1=B0=20(#242)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../_containers/account/SettingsProfileContainer.tsx | 7 ++++--- .../(main)/settings/_hooks/account/use-settings-profile.ts | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/apps/timo-web/app/[locale]/(main)/settings/_containers/account/SettingsProfileContainer.tsx b/apps/timo-web/app/[locale]/(main)/settings/_containers/account/SettingsProfileContainer.tsx index 9cd1c3a1..4eb8f665 100644 --- a/apps/timo-web/app/[locale]/(main)/settings/_containers/account/SettingsProfileContainer.tsx +++ b/apps/timo-web/app/[locale]/(main)/settings/_containers/account/SettingsProfileContainer.tsx @@ -6,13 +6,14 @@ import { useState } from "react"; import { TagLimitToastContainer } from "@/app/[locale]/(main)/(with-time-sidebar)/home/_containers/toast/TagLimitToastContainer"; import { SettingsProfileView } from "@/app/[locale]/(main)/settings/_components/account/SettingsProfileView"; -import { useSettingsProfile } from "@/app/[locale]/(main)/settings/_hooks/account/use-settings-profile"; +import { + MAX_SETTING_CUSTOM_TAG_COUNT, + useSettingsProfile, +} from "@/app/[locale]/(main)/settings/_hooks/account/use-settings-profile"; import { useSettingsProfileLabels } from "@/app/[locale]/(main)/settings/_hooks/account/use-settings-profile-labels"; import { CreateTagModalContainer } from "@/components/tag/CreateTagModalContainer"; import { AnimatedToast } from "@/components/toast/AnimatedToast"; -const MAX_SETTING_CUSTOM_TAG_COUNT = 4; - export const SettingsProfileContainer = () => { const tToast = useTranslations("Toast"); diff --git a/apps/timo-web/app/[locale]/(main)/settings/_hooks/account/use-settings-profile.ts b/apps/timo-web/app/[locale]/(main)/settings/_hooks/account/use-settings-profile.ts index 9c114db6..f395022a 100644 --- a/apps/timo-web/app/[locale]/(main)/settings/_hooks/account/use-settings-profile.ts +++ b/apps/timo-web/app/[locale]/(main)/settings/_hooks/account/use-settings-profile.ts @@ -27,7 +27,7 @@ const LANGUAGE_REQUEST_MAP: Record< en: UpdateLanguageRequestLanguage.EN, }; -const MAX_SETTING_CUSTOM_TAG_COUNT = 4; +export const MAX_SETTING_CUSTOM_TAG_COUNT = 4; export interface ActionErrorHandlers { onError: () => void; From 062e29a0f0da36072b75a32aab0a8240fc2ef388 Mon Sep 17 00:00:00 2001 From: yumin-kim4757 Date: Thu, 16 Jul 2026 13:46:54 +0900 Subject: [PATCH 4/4] =?UTF-8?q?fix(web):=20=ED=83=9C=EA=B7=B8=20=EC=83=9D?= =?UTF-8?q?=EC=84=B1=20=EC=A0=9C=ED=95=9C=20=ED=86=A0=EC=8A=A4=ED=8A=B8=20?= =?UTF-8?q?=EA=B8=B0=EC=A4=80=20=ED=86=B5=EC=9D=BC=20(#242)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../toast/TagLimitToastContainer.tsx | 3 ++- .../account/SettingsProfileContainer.tsx | 13 ++++--------- .../_hooks/account/use-settings-profile.ts | 9 +++++---- .../create/CreateTodoModalContent.tsx | 18 ++++-------------- .../detail/DetailTodoModalContent.tsx | 18 ++++-------------- .../hooks/todo-modal/common/use-tag-field.tsx | 12 ++++++++---- apps/timo-web/schemas/tag/tag-schema.ts | 2 ++ 7 files changed, 29 insertions(+), 46 deletions(-) diff --git a/apps/timo-web/app/[locale]/(main)/(with-time-sidebar)/home/_containers/toast/TagLimitToastContainer.tsx b/apps/timo-web/app/[locale]/(main)/(with-time-sidebar)/home/_containers/toast/TagLimitToastContainer.tsx index 47e1a9ad..ef832d76 100644 --- a/apps/timo-web/app/[locale]/(main)/(with-time-sidebar)/home/_containers/toast/TagLimitToastContainer.tsx +++ b/apps/timo-web/app/[locale]/(main)/(with-time-sidebar)/home/_containers/toast/TagLimitToastContainer.tsx @@ -3,6 +3,7 @@ import { useTranslations } from "next-intl"; import { useState } from "react"; import { AnimatedToast } from "@/components/toast/AnimatedToast"; +import { MAX_CUSTOM_TAG_COUNT } from "@/schemas/tag/tag-schema"; interface TagLimitToastContainerProps { count?: number; @@ -10,7 +11,7 @@ interface TagLimitToastContainerProps { } export const TagLimitToastContainer = ({ - count = 8, + count = MAX_CUSTOM_TAG_COUNT, onClose, }: TagLimitToastContainerProps) => { const [isOpen, setIsOpen] = useState(true); diff --git a/apps/timo-web/app/[locale]/(main)/settings/_containers/account/SettingsProfileContainer.tsx b/apps/timo-web/app/[locale]/(main)/settings/_containers/account/SettingsProfileContainer.tsx index 4eb8f665..607386ae 100644 --- a/apps/timo-web/app/[locale]/(main)/settings/_containers/account/SettingsProfileContainer.tsx +++ b/apps/timo-web/app/[locale]/(main)/settings/_containers/account/SettingsProfileContainer.tsx @@ -6,13 +6,11 @@ import { useState } from "react"; import { TagLimitToastContainer } from "@/app/[locale]/(main)/(with-time-sidebar)/home/_containers/toast/TagLimitToastContainer"; import { SettingsProfileView } from "@/app/[locale]/(main)/settings/_components/account/SettingsProfileView"; -import { - MAX_SETTING_CUSTOM_TAG_COUNT, - useSettingsProfile, -} from "@/app/[locale]/(main)/settings/_hooks/account/use-settings-profile"; +import { useSettingsProfile } from "@/app/[locale]/(main)/settings/_hooks/account/use-settings-profile"; import { useSettingsProfileLabels } from "@/app/[locale]/(main)/settings/_hooks/account/use-settings-profile-labels"; import { CreateTagModalContainer } from "@/components/tag/CreateTagModalContainer"; import { AnimatedToast } from "@/components/toast/AnimatedToast"; +import { MAX_CUSTOM_TAG_COUNT } from "@/schemas/tag/tag-schema"; export const SettingsProfileContainer = () => { const tToast = useTranslations("Toast"); @@ -46,7 +44,7 @@ export const SettingsProfileContainer = () => { (tag) => !tag.isDefault, ).length; - if (customTagCount >= MAX_SETTING_CUSTOM_TAG_COUNT) { + if (customTagCount >= MAX_CUSTOM_TAG_COUNT) { setIsTagLimitToastOpen(true); return; } @@ -93,10 +91,7 @@ export const SettingsProfileContainer = () => { /> {isTagLimitToastOpen && ( - setIsTagLimitToastOpen(false)} - /> + setIsTagLimitToastOpen(false)} /> )} void; } @@ -91,7 +92,7 @@ export const useSettingsProfile = () => { const handleCreateTag = (label: string, handlers: CreateTagHandlers) => { const customTagCount = tagItems.filter((tag) => !tag.isDefault).length; - if (customTagCount >= MAX_SETTING_CUSTOM_TAG_COUNT) { + if (customTagCount >= MAX_CUSTOM_TAG_COUNT) { handlers.onError(); return; } diff --git a/apps/timo-web/components/todo-modal/create/CreateTodoModalContent.tsx b/apps/timo-web/components/todo-modal/create/CreateTodoModalContent.tsx index 7230ca84..2af5b173 100644 --- a/apps/timo-web/components/todo-modal/create/CreateTodoModalContent.tsx +++ b/apps/timo-web/components/todo-modal/create/CreateTodoModalContent.tsx @@ -9,6 +9,7 @@ import { useController, useForm } from "react-hook-form"; import type { CreateTodoRequest } from "@/schemas/todo/todo-schema"; import type { PriorityLevel } from "@repo/timo-design-system/ui"; +import { TagLimitToastContainer } from "@/app/[locale]/(main)/(with-time-sidebar)/home/_containers/toast/TagLimitToastContainer"; import { OverlayModal } from "@/components/modal/OverlayModal"; import { AnimatedToast } from "@/components/toast/AnimatedToast"; import { TodoIconField } from "@/components/todo-modal/common/TodoIconField"; @@ -214,20 +215,9 @@ export const CreateTodoModalContent = ({ - - {tToast.rich("tagLimit", { - count: 8, - blue: (chunks) => ( - {chunks} - ), - })} -

- } - /> + {tagField.isTagLimitToastOpen && ( + + )} - - {tToast.rich("tagLimit", { - count: 8, - blue: (chunks) => ( - {chunks} - ), - })} -

- } - /> + {detailTodoForm.isTagLimitToastOpen && ( + + )} { control: Control; name?: Path; @@ -61,6 +62,9 @@ export const useTagField = ({ const selectedTagOption = tagOptions.find( (option) => option.id === field.value, ); + const customTagCount = (tagsQuery.data?.tags ?? []).filter( + (tag) => !tag.isDefault, + ).length; const handleSelectTag = (label: string) => { const option = tagOptions.find((item) => item.label === label); @@ -74,7 +78,7 @@ export const useTagField = ({ }; const handleAddTagClick = () => { - if (tagOptions.length >= MAX_TAG_COUNT) { + if (customTagCount >= MAX_CUSTOM_TAG_COUNT) { setIsTagLimitToastOpen(true); return; } diff --git a/apps/timo-web/schemas/tag/tag-schema.ts b/apps/timo-web/schemas/tag/tag-schema.ts index 349f043a..60d0787b 100644 --- a/apps/timo-web/schemas/tag/tag-schema.ts +++ b/apps/timo-web/schemas/tag/tag-schema.ts @@ -1,5 +1,7 @@ import { z } from "zod"; +export const MAX_CUSTOM_TAG_COUNT = 4; + export const tagSchema = z.object({ tagId: z.number(), name: z.string(),