diff --git a/src/components/App.tsx b/src/components/App.tsx index b852cf1..54da305 100644 --- a/src/components/App.tsx +++ b/src/components/App.tsx @@ -18,7 +18,7 @@ setDefaultOptions({ locale: enGB }); const App = () => { React.useEffect(() => { document.getElementById('root')?.classList.add('initialized'); - }); + }, []); return ( diff --git a/src/components/calendar-month/CalendarCell.tsx b/src/components/calendar-month/CalendarCell.tsx index a6c1438..6ec9b46 100644 --- a/src/components/calendar-month/CalendarCell.tsx +++ b/src/components/calendar-month/CalendarCell.tsx @@ -69,8 +69,9 @@ const CalendarCell = ({ const screenSize = useScreenSize(); const date = format( new Date(fullYear, monthNumber - 1, dateNumber), - 'yyyy-MM-d' + 'yyyy-MM-dd' ); + const occurrences = isCalendarDay(date) ? occurrencesByDate[date] || [] : []; const isMobile = screenSize < 768; const hasNote = notes.some((note) => note.day === date); diff --git a/src/components/calendar-month/CalendarHeader.tsx b/src/components/calendar-month/CalendarHeader.tsx index fbdec8e..32477ad 100644 --- a/src/components/calendar-month/CalendarHeader.tsx +++ b/src/components/calendar-month/CalendarHeader.tsx @@ -55,6 +55,7 @@ const CalendarHeader = ({ const { filteredBy, filterBy } = useOccurrencesStore(); const user = useUser(); const screenSize = useScreenSize(); + const isOnCurrentMonth = activeMonthLabel === MONTHS[new Date().getMonth()]; const shouldRenderFilters = !!user && habits.length > 0 && traits.length > 0; @@ -96,7 +97,7 @@ const CalendarHeader = ({
- {!isMobile && ( + {!isMobile && !isOnCurrentMonth && (