Skip to content

Commit

Permalink
changed in event calendar
Browse files Browse the repository at this point in the history
  • Loading branch information
gurramkarthiknetha committed Dec 22, 2024
1 parent d215d23 commit fb66d91
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/components/EventCalendar/EventCalendar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,9 @@ const Calendar: React.FC<InterfaceCalendarProps> = ({
return Array.isArray(holidays)
? holidays.filter((holiday) => {
if (!holiday.date) {
console.warn(`Holiday "${holiday.name}" has no date specified.`);
if (process.env.NODE_ENV !== 'test') {
console.warn(`Holiday "${holiday.name}" has no date specified.`);

Check warning on line 143 in src/components/EventCalendar/EventCalendar.tsx

View check run for this annotation

Codecov / codecov/patch

src/components/EventCalendar/EventCalendar.tsx#L143

Added line #L143 was not covered by tests
}
return false;

Check warning on line 145 in src/components/EventCalendar/EventCalendar.tsx

View check run for this annotation

Codecov / codecov/patch

src/components/EventCalendar/EventCalendar.tsx#L145

Added line #L145 was not covered by tests
}
const holidayMonth = dayjs(holiday.date, 'MM-DD', true).month();
Expand Down Expand Up @@ -270,6 +272,11 @@ const Calendar: React.FC<InterfaceCalendarProps> = ({
(windowWidth <= 700 && allDayEventsList.length > 0)
);
}, [allDayEventsList.length, windowWidth]);

const handleExpandClick: () => void = () => {
toggleExpand(-100);

Check warning on line 277 in src/components/EventCalendar/EventCalendar.tsx

View check run for this annotation

Codecov / codecov/patch

src/components/EventCalendar/EventCalendar.tsx#L277

Added line #L277 was not covered by tests
};

return (
<>
<div className={styles.calendar_hour_block}>
Expand Down Expand Up @@ -314,7 +321,7 @@ const Calendar: React.FC<InterfaceCalendarProps> = ({
{Array.isArray(allDayEventsList) && (
<button
className={styles.btn__more}
onClick={() => toggleExpand(-100)}
onClick={handleExpandClick}
>
{shouldShowViewMore
? expanded === -100
Expand Down

0 comments on commit fb66d91

Please sign in to comment.