From c4efbadf897439fbc9f374528c1a2cf1f802ad9a Mon Sep 17 00:00:00 2001 From: zmeyer44 Date: Tue, 31 Oct 2023 07:15:31 -0400 Subject: [PATCH] added clearer error message --- components/Modals/CreateCalendarEvent.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/components/Modals/CreateCalendarEvent.tsx b/components/Modals/CreateCalendarEvent.tsx index 0f9817b..ca39faa 100644 --- a/components/Modals/CreateCalendarEvent.tsx +++ b/components/Modals/CreateCalendarEvent.tsx @@ -84,7 +84,10 @@ export default function CreateCalendarEventModal() { useEffect(() => { if (error["title"]) { if (title) { - setError((prev) => ({ ...prev, title: undefined })); + setError((prev) => ({ + ...prev, + title: undefined, + })); } } }, [title, error]); @@ -97,7 +100,7 @@ export default function CreateCalendarEventModal() { if (!title) { setError({ - title: "Please add a title", + title: "Please add an event name", }); return; } @@ -451,6 +454,9 @@ export default function CreateCalendarEventModal() { )} + {!!error["title"] && ( +

{error["title"]}

+ )}