diff --git a/apps/timo-web/app/[locale]/(main)/(with-time-sidebar)/home/_containers/todo-card/HomeDayHeaderContainer.tsx b/apps/timo-web/app/[locale]/(main)/(with-time-sidebar)/home/_containers/todo-card/HomeDayHeaderContainer.tsx index d7c51203..9d2fb32a 100644 --- a/apps/timo-web/app/[locale]/(main)/(with-time-sidebar)/home/_containers/todo-card/HomeDayHeaderContainer.tsx +++ b/apps/timo-web/app/[locale]/(main)/(with-time-sidebar)/home/_containers/todo-card/HomeDayHeaderContainer.tsx @@ -39,7 +39,7 @@ export const HomeDayHeaderContainer = ({ totalCount={totalCount} completedCount={completedCount} /> - + ); }; diff --git a/apps/timo-web/app/[locale]/(main)/(with-time-sidebar)/today/_containers/TodayDateHeaderContainer.tsx b/apps/timo-web/app/[locale]/(main)/(with-time-sidebar)/today/_containers/TodayDateHeaderContainer.tsx index 42128418..36237f0a 100644 --- a/apps/timo-web/app/[locale]/(main)/(with-time-sidebar)/today/_containers/TodayDateHeaderContainer.tsx +++ b/apps/timo-web/app/[locale]/(main)/(with-time-sidebar)/today/_containers/TodayDateHeaderContainer.tsx @@ -42,6 +42,7 @@ export const TodayDateHeaderContainer = ({ void; } export const CreateTodoModalContainer = ({ defaultDate, buttonVariant = "default", + totalCount = 0, onSubmit, }: CreateTodoModalContainerProps) => { const t = useTranslations("Home"); const tToast = useTranslations("Toast"); const { handleSubmit, isErrorToastOpen, closeErrorToast } = useCreateTodoSubmit(); + const [isTodoLimitToastOpen, setIsTodoLimitToastOpen] = useState(false); const submitTodo = onSubmit ?? handleSubmit; const handleAddClick = () => { + if (totalCount >= MAX_TODO_COUNT) { + setIsTodoLimitToastOpen(true); + return; + } + overlay.open(({ isOpen, close, unmount }) => ( + + setIsTodoLimitToastOpen(false)} + message={ + <> +

+ {tToast.rich("todoLimitLine1", { + blue: (chunks) => ( + {chunks} + ), + })} +

+

{tToast("todoLimitLine2")}

+ + } + /> ); }; diff --git a/apps/timo-web/components/todo-modal/create/CreateTodoTaskFields.tsx b/apps/timo-web/components/todo-modal/create/CreateTodoTaskFields.tsx index e69118e7..4216658a 100644 --- a/apps/timo-web/components/todo-modal/create/CreateTodoTaskFields.tsx +++ b/apps/timo-web/components/todo-modal/create/CreateTodoTaskFields.tsx @@ -38,7 +38,11 @@ export const CreateTodoTaskFields = ({ return (
- {}} /> + {}} + className="cursor-default" + />