From 0dba4b26b1f0c554f48073ba987e3761658cf975 Mon Sep 17 00:00:00 2001 From: Dominik Hryshaiev Date: Sat, 18 Jan 2025 05:15:31 +0100 Subject: [PATCH] feat: finalize theme colors --- src/components/App.tsx | 2 +- .../calendar-month/MonthCalendar.tsx | 6 +-- src/components/calendar-month/NoteDialog.tsx | 4 +- src/components/header/Header.tsx | 2 +- src/services/occurrences.service.ts | 1 + tailwind.config.ts | 42 +++++++++---------- 6 files changed, 29 insertions(+), 28 deletions(-) diff --git a/src/components/App.tsx b/src/components/App.tsx index ca120a6..d303664 100644 --- a/src/components/App.tsx +++ b/src/components/App.tsx @@ -23,7 +23,7 @@ const App = () => { return ( -
+
{ const handleOccurrenceModalClose = () => { window.setTimeout(() => { - closeOccurrenceDialog(); setActiveDate(null); + closeOccurrenceDialog(); }, 0); }; @@ -102,14 +102,14 @@ const MonthCalendar = () => { monthIndex: number, fullYear: number ) => { - openOccurrenceDialog(); setActiveDate(new Date(fullYear, monthIndex - 1, dateNumber, 12)); + openOccurrenceDialog(); }; const handleNoteModalClose = () => { window.setTimeout(() => { - closeNoteDialog(); setActiveDate(null); + closeNoteDialog(); }, 0); }; diff --git a/src/components/calendar-month/NoteDialog.tsx b/src/components/calendar-month/NoteDialog.tsx index f41db9c..417ba3c 100644 --- a/src/components/calendar-month/NoteDialog.tsx +++ b/src/components/calendar-month/NoteDialog.tsx @@ -42,10 +42,10 @@ const NoteDialog = ({ open, onClose, date }: NoteDialogProps) => { }); React.useEffect(() => { - if (existingNote) { + if (existingNote?.content && !content) { setContent(existingNote.content); } - }, [existingNote]); + }, [existingNote, content]); const handleSubmit: MouseEventHandler = async (event) => { event.preventDefault(); diff --git a/src/components/header/Header.tsx b/src/components/header/Header.tsx index 7e6eecf..72d51ff 100644 --- a/src/components/header/Header.tsx +++ b/src/components/header/Header.tsx @@ -16,7 +16,7 @@ const Header = () => { return ( <> {session.isLoading && ( -
+