From 759cde4f66b5617d11409258e7108f3db0dc479b Mon Sep 17 00:00:00 2001 From: Gurram Karthik Date: Tue, 17 Dec 2024 14:12:56 +0530 Subject: [PATCH 01/10] fixed-1887 --- .../EventCalendar/EventCalendar.module.css | 176 +++++++++++- .../EventCalendar/EventCalendar.tsx | 260 +++++++----------- 2 files changed, 265 insertions(+), 171 deletions(-) diff --git a/src/components/EventCalendar/EventCalendar.module.css b/src/components/EventCalendar/EventCalendar.module.css index 921af48bae..96fb1c35ae 100644 --- a/src/components/EventCalendar/EventCalendar.module.css +++ b/src/components/EventCalendar/EventCalendar.module.css @@ -271,14 +271,6 @@ .expand_event_list { display: block; } - -.list_container { - padding: 5px; - width: fit-content; - display: flex; - flex-direction: row; -} - .event_list_hour { display: flex; flex-direction: row; @@ -316,7 +308,8 @@ flex-grow: 1; } -@media only screen and (max-width: 700px) { +@media only screen and (max-width: var(--mobile-breakpoint)) { + /** @breakpoint --mobile-breakpoint: 768px */ .event_list { display: none; } @@ -331,7 +324,7 @@ } } -@media only screen and (max-width: 500px) { +@media only screen and (max-width: var(--small-mobile-breakpoint)) { .btn__more { font-size: 12px; } @@ -344,7 +337,22 @@ gap: 10px; margin-top: 35px; } +.base_card { + flex: 1; + padding: 20px; + border-radius: 10px; + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15); +} + +.holidays_card { + composes: base_card; + background-color: var(--holiday-card-bg); +} +.events_card { + composes: base_card; + background-color: #ffffff; +} .card__holidays { background-color: rgba(246, 242, 229, 1); display: flex; @@ -415,9 +423,149 @@ border-radius: 10px; } -.userEvents__color { - height: 15px; - width: 40px; - background: rgba(146, 200, 141, 0.5); +.baseIndicator { + border-radius: 5px; + width: 20px; + height: 12px; + display: inline-block; +} + +.holidayText { + font-size: 14px; + color: #555555; +} +.eventsLegend { + display: flex; + align-items: center; + gap: 8px; +} + +.list_container { + padding: 5px; + width: fit-content; + display: flex; + align-items: center; + gap: var(--indicator-spacing); +} + +.holidayIndicator { + composes: baseIndicator; + background-color: rgba(0, 0, 0, 0.15); +} + +:root { + /* Color scheme for holiday-related elements */ + --color-user-event: rgba(139, 195, 74, 1); + /* Holiday colors */ + --color-holiday-indicator: rgba(0, 0, 0, 0.15); + --color-holiday-date: rgba(255, 152, 0, 1); + /* Breakpoints for responsive design */ + --mobile-breakpoint: 700px; + --small-mobile-breakpoint: 480px; + --text-color-primary: rgba(51, 51, 51, 1); + --text-color-secondary: rgba(85, 85, 85, 1); + /* Card styles */ + --card-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); + --holiday-card-bg: #f6f2e5; + --holiday-date-color: #ea7b56; + --indicator-spacing: 8px; + /* Interactive states */ + --hover-bg-color: rgba(0, 0, 0, 0.05); +} +.organizationIndicator { + composes: baseIndicator; + background-color: rgba(82, 172, 255, 0.5); +} + +.legendText { + font-size: 14px; + color: #555555; +} +@media only screen and (max-width: var(--mobile-breakpoint)) { + .list_container, + .eventsLegend { + gap: 4px; + } + + .holidayIndicator, + .organizationIndicator { + width: 16px; + height: 10px; + } + + .holidayText, + .legendText { + font-size: 12px; + } +} +.card_title { + font-size: 16px; + font-weight: 600; + color: var(--text-color-primary); + margin-bottom: 15px; +} + +.card_list { + list-style: none; + padding: 0; + margin: 0; +} + +.card_list_item { + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 10px; + font-size: 14px; + color: var(--text-color-secondary); +} + +.holiday_date { + font-weight: 500; + color: var(--holiday-date-color); +} +.calendar_infocards { + display: flex; + flex-direction: row; + justify-content: space-between; + align-items: flex-start; + gap: 20px; + padding: 20px; + background-color: var(--grey-bg-color); +} +.holidays_card, +.events_card { + flex: 1; + padding: 20px; border-radius: 10px; + box-shadow: var(--card-shadow); +} + +.holidays_card { + background-color: var(--holiday-card-bg); +} + +.events_card { + background-color: white; +} + +.legend { + display: flex; + flex-direction: column; + gap: 12px; +} + +.userEvents__color { + composes: baseIndicator; + display: inline-block; + background-color: rgba(139, 195, 74, 1); +} + +.card_list_item:hover { + background-color: var(--hover-bg-color); + transition: background-color 0.2s ease; +} +.card_list_item:focus-visible { + background-color: var(--hover-bg-color); + transition: background-color 0.2s ease; } diff --git a/src/components/EventCalendar/EventCalendar.tsx b/src/components/EventCalendar/EventCalendar.tsx index 592456f295..a087b3f999 100644 --- a/src/components/EventCalendar/EventCalendar.tsx +++ b/src/components/EventCalendar/EventCalendar.tsx @@ -1,16 +1,14 @@ import EventListCard from 'components/EventListCard/EventListCard'; import dayjs from 'dayjs'; +import React, { useState, useEffect, useMemo } from 'react'; import Button from 'react-bootstrap/Button'; -import React, { useState, useEffect } from 'react'; import styles from './EventCalendar.module.css'; import { ChevronLeft, ChevronRight } from '@mui/icons-material'; -import CurrentHourIndicator from 'components/CurrentHourIndicator/CurrentHourIndicator'; import { ViewType } from 'screens/OrganizationEvents/OrganizationEvents'; import HolidayCard from '../HolidayCards/HolidayCard'; -import { holidays, hours, months, weekdays } from './constants'; +import { holidays, months, weekdays } from './constants'; import type { InterfaceRecurrenceRule } from 'utils/recurrenceUtils'; import YearlyEventCalender from './YearlyEventCalender'; - interface InterfaceEventListCardProps { userRole?: string; key?: string; @@ -75,7 +73,6 @@ const Calendar: React.FC = ({ ); const [expanded, setExpanded] = useState(-1); const [windowWidth, setWindowWidth] = useState(window.screen.width); - useEffect(() => { function handleResize(): void { setWindowWidth(window.screen.width); @@ -139,11 +136,35 @@ const Calendar: React.FC = ({ } }; - /** - * Moves the calendar view to the next month. - */ + const filteredHolidays = useMemo(() => { + if (!Array.isArray(holidays)) { + throw new Error('Invalid holidays array'); + } + + return holidays.filter((holiday) => { + if (!holiday.date) { + console.warn(`Holiday "${holiday.name}" has no date specified.`); + return false; + } + + try { + if (holiday.date) { + const holidayMonth = dayjs(holiday.date, 'MM-DD', true).month(); + return holidayMonth === currentMonth; + } else { + console.warn(`Holiday "${holiday.name}" has no date specified.`); + return false; + } + } catch (error) { + console.error( + `Error processing holiday "${holiday.name}": ${error instanceof Error ? error.message : 'Unknown error'}`, + ); + return false; + } + }); + }, [holidays, currentMonth]); + const handleNextMonth = (): void => { - /*istanbul ignore next*/ if (currentMonth === 11) { setCurrentMonth(0); setCurrentYear(currentYear + 1); @@ -151,12 +172,7 @@ const Calendar: React.FC = ({ setCurrentMonth(currentMonth + 1); } }; - - /** - * Moves the calendar view to the previous date. - */ const handlePrevDate = (): void => { - /*istanbul ignore next*/ if (currentDate > 1) { setCurrentDate(currentDate - 1); } else { @@ -175,15 +191,12 @@ const Calendar: React.FC = ({ } } }; - /*istanbul ignore next*/ const handleNextDate = (): void => { - /*istanbul ignore next*/ const lastDayOfCurrentMonth = new Date( currentYear, currentMonth - 1, 0, ).getDate(); - /*istanbul ignore next*/ if (currentDate < lastDayOfCurrentMonth) { setCurrentDate(currentDate + 1); } else { @@ -198,11 +211,7 @@ const Calendar: React.FC = ({ } }; - /** - * Moves the calendar view to today's date. - */ const handleTodayButton = (): void => { - /*istanbul ignore next*/ setCurrentYear(today.getFullYear()); setCurrentMonth(today.getMonth()); setCurrentDate(today.getDate()); @@ -215,7 +224,6 @@ const Calendar: React.FC = ({ '0', )}:${String(Math.abs(new Date().getTimezoneOffset()) % 60).padStart(2, '0')}`; - /*istanbul ignore next*/ const renderHours = (): JSX.Element => { const toggleExpand = (index: number): void => { if (expanded === index) { @@ -224,12 +232,9 @@ const Calendar: React.FC = ({ setExpanded(index); } }; - - /*istanbul ignore next*/ const allDayEventsList: JSX.Element[] = events ?.filter((datas) => { - /*istanbul ignore next*/ const currDate = new Date(currentYear, currentMonth, currentDate); if ( datas.startTime == undefined && @@ -273,6 +278,12 @@ const Calendar: React.FC = ({ ); }) || []; + const shouldShowViewMore = useMemo(() => { + return ( + allDayEventsList.length > 2 || + (windowWidth <= 700 && allDayEventsList.length > 0) + ); + }, [allDayEventsList.length, windowWidth]); return ( <>
@@ -293,7 +304,6 @@ const Calendar: React.FC = ({ ? styles.expand_list_container : styles.list_container } - style={{ width: 'fit-content' }} >
= ({ : styles.event_list_hour } > - {expanded === -100 - ? allDayEventsList - : allDayEventsList?.slice(0, 1)} + {Array.isArray(allDayEventsList) && + allDayEventsList.length > 0 ? ( + expanded === -100 ? ( + allDayEventsList + ) : ( + allDayEventsList.slice(0, 1) + ) + ) : ( +

+ No events available +

+ )}
- {(allDayEventsList?.length > 2 || - (windowWidth <= 700 && allDayEventsList?.length > 0)) && ( + {Array.isArray(allDayEventsList) && ( )}
- {hours.map((hour, index) => { - const timeEventsList: JSX.Element[] = - events - ?.filter((datas) => { - const currDate = new Date( - currentYear, - currentMonth, - currentDate, - ); - - if ( - parseInt(datas.startTime?.slice(0, 2) as string).toString() == - (index % 24).toString() && - datas.startDate == dayjs(currDate).format('YYYY-MM-DD') - ) { - return datas; - } - }) - .map((datas: InterfaceEventListCardProps) => { - const attendees: { _id: string }[] = []; - datas.attendees?.forEach((attendee: { _id: string }) => { - const r = { - _id: attendee._id, - }; - attendees.push(r); - }); +
+
+

Holidays

+
    + {filteredHolidays.map((holiday, index) => ( +
  • + + {months[parseInt(holiday.date.slice(0, 2), 10) - 1]}{' '} + {holiday.date.slice(3)} + + {holiday.name} +
  • + ))} +
+
- return ( - - ); - }) || []; - /*istanbul ignore next*/ - return ( -
-
-

{`${hour}`}

+
+

Events

+
+
+ + Holidays
-
-
0 - ? styles.event_list_parent_current - : styles.event_list_parent - } - > - {index % 24 == new Date().getHours() && - new Date().getDate() == currentDate && ( - - )} -
-
- {/*istanbul ignore next*/} - {expanded === index - ? timeEventsList - : timeEventsList?.slice(0, 1)} -
- {(timeEventsList?.length > 1 || - (windowWidth <= 700 && timeEventsList?.length > 0)) && ( - - )} -
+
+ + + Events Created by Organization + +
+
+ + + Events Created by User +
- ); - })} +
+
); }; @@ -457,22 +414,20 @@ const Calendar: React.FC = ({ return days.map((date, index) => { const className = [ date.getDay() === 0 || date.getDay() === 6 ? styles.day_weekends : '', - date.toLocaleDateString() === today.toLocaleDateString() //Styling for today day cell + date.toLocaleDateString() === today.toLocaleDateString() ? styles.day__today : '', - date.getMonth() !== currentMonth ? styles.day__outside : '', //Styling for days outside the current month + date.getMonth() !== currentMonth ? styles.day__outside : '', selectedDate?.getTime() === date.getTime() ? styles.day__selected : '', styles.day, ].join(' '); const toggleExpand = (index: number): void => { - /*istanbul ignore next*/ if (expanded === index) { setExpanded(-1); } else { setExpanded(index); } }; - /*istanbul ignore next*/ const allEventsList: JSX.Element[] = events ?.filter((datas) => { @@ -521,6 +476,7 @@ const Calendar: React.FC = ({ .map((holiday) => { return ; }); + return (
= ({ >
= ({
{(allEventsList?.length > 2 || (windowWidth <= 700 && allEventsList?.length > 0)) && ( - /*istanbul ignore next*/ )}
@@ -622,7 +572,7 @@ const Calendar: React.FC = ({ )}
{viewType == ViewType.MONTH ? ( -
+ <>
{weekdays.map((weekday, index) => (
@@ -631,18 +581,14 @@ const Calendar: React.FC = ({ ))}
{renderDays()}
-
+ + ) : viewType == ViewType.YEAR ? ( + ) : ( - // -
- {viewType == ViewType.YEAR ? ( - - ) : ( -
{renderHours()}
- )} -
+
{renderHours()}
)}
+
{viewType == ViewType.YEAR ? ( From 4f1c19e5e729ef25eb8bfff16db030f9ce935468 Mon Sep 17 00:00:00 2001 From: Gurram Karthik Date: Tue, 17 Dec 2024 14:36:27 +0530 Subject: [PATCH 02/10] changed acc to bot --- .../EventCalendar/EventCalendar.module.css | 3 +- .../EventCalendar/EventCalendar.tsx | 37 +++++-------------- 2 files changed, 12 insertions(+), 28 deletions(-) diff --git a/src/components/EventCalendar/EventCalendar.module.css b/src/components/EventCalendar/EventCalendar.module.css index 96fb1c35ae..e025f7cce1 100644 --- a/src/components/EventCalendar/EventCalendar.module.css +++ b/src/components/EventCalendar/EventCalendar.module.css @@ -467,7 +467,7 @@ /* Card styles */ --card-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); --holiday-card-bg: #f6f2e5; - --holiday-date-color: #ea7b56; + --holiday-date-color: #d35400; --indicator-spacing: 8px; /* Interactive states */ --hover-bg-color: rgba(0, 0, 0, 0.05); @@ -524,6 +524,7 @@ font-weight: 500; color: var(--holiday-date-color); } + .calendar_infocards { display: flex; flex-direction: row; diff --git a/src/components/EventCalendar/EventCalendar.tsx b/src/components/EventCalendar/EventCalendar.tsx index a087b3f999..f16d2f29e0 100644 --- a/src/components/EventCalendar/EventCalendar.tsx +++ b/src/components/EventCalendar/EventCalendar.tsx @@ -137,31 +137,16 @@ const Calendar: React.FC = ({ }; const filteredHolidays = useMemo(() => { - if (!Array.isArray(holidays)) { - throw new Error('Invalid holidays array'); - } - - return holidays.filter((holiday) => { - if (!holiday.date) { - console.warn(`Holiday "${holiday.name}" has no date specified.`); - return false; - } - - try { - if (holiday.date) { + return Array.isArray(holidays) + ? holidays.filter((holiday) => { + if (!holiday.date) { + console.warn(`Holiday "${holiday.name}" has no date specified.`); + return false; + } const holidayMonth = dayjs(holiday.date, 'MM-DD', true).month(); return holidayMonth === currentMonth; - } else { - console.warn(`Holiday "${holiday.name}" has no date specified.`); - return false; - } - } catch (error) { - console.error( - `Error processing holiday "${holiday.name}": ${error instanceof Error ? error.message : 'Unknown error'}`, - ); - return false; - } - }); + }) + : []; }, [holidays, currentMonth]); const handleNextMonth = (): void => { @@ -469,10 +454,8 @@ const Calendar: React.FC = ({ ); }) || []; - const holidayList: JSX.Element[] = holidays - .filter((holiday) => { - if (holiday.date == dayjs(date).format('MM-DD')) return holiday; - }) + const holidayList: JSX.Element[] = filteredHolidays + .filter((holiday) => holiday.date === dayjs(date).format('MM-DD')) .map((holiday) => { return ; }); From 5da0561a73ddd8aae855217f11ef229c74323619 Mon Sep 17 00:00:00 2001 From: Gurram Karthik Date: Thu, 19 Dec 2024 20:10:37 +0530 Subject: [PATCH 03/10] final change --- .../OrganizationScreen/OrganizationScreen.test.tsx | 11 +++++------ src/screens/UserPortal/Posts/Posts.test.tsx | 5 ++++- src/setupTests.ts | 2 +- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/components/OrganizationScreen/OrganizationScreen.test.tsx b/src/components/OrganizationScreen/OrganizationScreen.test.tsx index cd039cc3ca..eaa0cc2396 100644 --- a/src/components/OrganizationScreen/OrganizationScreen.test.tsx +++ b/src/components/OrganizationScreen/OrganizationScreen.test.tsx @@ -80,16 +80,15 @@ describe('Testing OrganizationScreen', () => { const closeButton = screen.getByTestId('closeMenu'); fireEvent.click(closeButton); - // Check for contract class after closing - expect(screen.getByTestId('mainpageright')).toHaveClass('_expand_ccl5z_8'); + // Check for a class indicating the drawer is contracted (use stringContaining in the class) + const mainPageElement = screen.getByTestId('mainpageright'); + expect(mainPageElement.className).toMatch('_expand'); // Simply check if _expand exists const openButton = screen.getByTestId('openMenu'); fireEvent.click(openButton); - // Check for expand class after opening - expect(screen.getByTestId('mainpageright')).toHaveClass( - '_contract_ccl5z_61', - ); + // Check for a class indicating the drawer is expanded + expect(mainPageElement.className).toMatch('_contract'); }); test('handles window resize', () => { diff --git a/src/screens/UserPortal/Posts/Posts.test.tsx b/src/screens/UserPortal/Posts/Posts.test.tsx index aa5f03fdcf..433e36f94a 100644 --- a/src/screens/UserPortal/Posts/Posts.test.tsx +++ b/src/screens/UserPortal/Posts/Posts.test.tsx @@ -1,7 +1,7 @@ import React, { act } from 'react'; import { MockedProvider } from '@apollo/react-testing'; import type { RenderResult } from '@testing-library/react'; -import { render, screen, waitFor, within } from '@testing-library/react'; +import { render, screen, within } from '@testing-library/react'; import { I18nextProvider } from 'react-i18next'; import userEvent from '@testing-library/user-event'; import { @@ -395,5 +395,8 @@ describe('HomeScreen with invalid orgId', () => { ); const homeEl = await screen.findByTestId('homeEl'); expect(homeEl).toBeInTheDocument(); + + const postCardContainers = screen.queryAllByTestId('postCardContainer'); + expect(postCardContainers).toHaveLength(0); }); }); diff --git a/src/setupTests.ts b/src/setupTests.ts index eac7093309..1aa46e722f 100644 --- a/src/setupTests.ts +++ b/src/setupTests.ts @@ -32,4 +32,4 @@ jestPreviewConfigure({ autoPreview: true, }); -jest.setTimeout(15000); +jest.setTimeout(100000); From fb0602ab492b2d474f9513102f483c2491891b98 Mon Sep 17 00:00:00 2001 From: Gurram Karthik Date: Thu, 19 Dec 2024 22:32:39 +0530 Subject: [PATCH 04/10] gitpush final change --- .../OrganizationScreen/OrganizationScreen.test.tsx | 11 +++++------ src/setupTests.ts | 2 +- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/components/OrganizationScreen/OrganizationScreen.test.tsx b/src/components/OrganizationScreen/OrganizationScreen.test.tsx index cd039cc3ca..eaa0cc2396 100644 --- a/src/components/OrganizationScreen/OrganizationScreen.test.tsx +++ b/src/components/OrganizationScreen/OrganizationScreen.test.tsx @@ -80,16 +80,15 @@ describe('Testing OrganizationScreen', () => { const closeButton = screen.getByTestId('closeMenu'); fireEvent.click(closeButton); - // Check for contract class after closing - expect(screen.getByTestId('mainpageright')).toHaveClass('_expand_ccl5z_8'); + // Check for a class indicating the drawer is contracted (use stringContaining in the class) + const mainPageElement = screen.getByTestId('mainpageright'); + expect(mainPageElement.className).toMatch('_expand'); // Simply check if _expand exists const openButton = screen.getByTestId('openMenu'); fireEvent.click(openButton); - // Check for expand class after opening - expect(screen.getByTestId('mainpageright')).toHaveClass( - '_contract_ccl5z_61', - ); + // Check for a class indicating the drawer is expanded + expect(mainPageElement.className).toMatch('_contract'); }); test('handles window resize', () => { diff --git a/src/setupTests.ts b/src/setupTests.ts index eac7093309..1aa46e722f 100644 --- a/src/setupTests.ts +++ b/src/setupTests.ts @@ -32,4 +32,4 @@ jestPreviewConfigure({ autoPreview: true, }); -jest.setTimeout(15000); +jest.setTimeout(100000); From 644921f9634d270669bd4e113340ab78c2abe242 Mon Sep 17 00:00:00 2001 From: Gurram Karthik Date: Fri, 20 Dec 2024 09:36:02 +0530 Subject: [PATCH 05/10] 1 conflict resloved --- .../OrganizationScreen/OrganizationScreen.test.tsx | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/components/OrganizationScreen/OrganizationScreen.test.tsx b/src/components/OrganizationScreen/OrganizationScreen.test.tsx index eaa0cc2396..bfa6821c12 100644 --- a/src/components/OrganizationScreen/OrganizationScreen.test.tsx +++ b/src/components/OrganizationScreen/OrganizationScreen.test.tsx @@ -80,15 +80,12 @@ describe('Testing OrganizationScreen', () => { const closeButton = screen.getByTestId('closeMenu'); fireEvent.click(closeButton); - // Check for a class indicating the drawer is contracted (use stringContaining in the class) - const mainPageElement = screen.getByTestId('mainpageright'); - expect(mainPageElement.className).toMatch('_expand'); // Simply check if _expand exists - + expect(screen.getByTestId('mainpageright')).toHaveClass(styles.expand); const openButton = screen.getByTestId('openMenu'); fireEvent.click(openButton); - // Check for a class indicating the drawer is expanded - expect(mainPageElement.className).toMatch('_contract'); + // Check for expand class after opening + expect(screen.getByTestId('mainpageright')).toHaveClass(styles.contract); }); test('handles window resize', () => { From 0822277efd3f871c3f21dc481a48f9602ac2758d Mon Sep 17 00:00:00 2001 From: Gurram Karthik Date: Fri, 20 Dec 2024 09:40:47 +0530 Subject: [PATCH 06/10] 1 conflict reslove --- src/components/OrganizationScreen/OrganizationScreen.test.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/OrganizationScreen/OrganizationScreen.test.tsx b/src/components/OrganizationScreen/OrganizationScreen.test.tsx index bfa6821c12..0dfb6d7a14 100644 --- a/src/components/OrganizationScreen/OrganizationScreen.test.tsx +++ b/src/components/OrganizationScreen/OrganizationScreen.test.tsx @@ -81,6 +81,7 @@ describe('Testing OrganizationScreen', () => { fireEvent.click(closeButton); expect(screen.getByTestId('mainpageright')).toHaveClass(styles.expand); + const openButton = screen.getByTestId('openMenu'); fireEvent.click(openButton); From 60ffeecb1cd4f772d7d01e6c83743b9e92b230f1 Mon Sep 17 00:00:00 2001 From: Gurram Karthik Date: Fri, 20 Dec 2024 09:53:10 +0530 Subject: [PATCH 07/10] 2nd conflict resloved --- src/components/EventCalendar/EventCalendar.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/components/EventCalendar/EventCalendar.tsx b/src/components/EventCalendar/EventCalendar.tsx index f16d2f29e0..feaea0667e 100644 --- a/src/components/EventCalendar/EventCalendar.tsx +++ b/src/components/EventCalendar/EventCalendar.tsx @@ -176,6 +176,7 @@ const Calendar: React.FC = ({ } } }; + const handleNextDate = (): void => { const lastDayOfCurrentMonth = new Date( currentYear, @@ -217,6 +218,7 @@ const Calendar: React.FC = ({ setExpanded(index); } }; + const allDayEventsList: JSX.Element[] = events ?.filter((datas) => { @@ -413,6 +415,7 @@ const Calendar: React.FC = ({ setExpanded(index); } }; + const allEventsList: JSX.Element[] = events ?.filter((datas) => { From 5015f146e134af4cfc2a21acfd8fc4117947456e Mon Sep 17 00:00:00 2001 From: Gurram Karthik Date: Sat, 21 Dec 2024 22:49:35 +0530 Subject: [PATCH 08/10] changed css acc to gautam-divyanshu --- src/components/EventCalendar/EventCalendar.module.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/EventCalendar/EventCalendar.module.css b/src/components/EventCalendar/EventCalendar.module.css index e025f7cce1..607d750f85 100644 --- a/src/components/EventCalendar/EventCalendar.module.css +++ b/src/components/EventCalendar/EventCalendar.module.css @@ -513,7 +513,6 @@ .card_list_item { display: flex; - justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: 14px; @@ -522,6 +521,7 @@ .holiday_date { font-weight: 500; + margin-right: 10px; color: var(--holiday-date-color); } From d215d23262d4e62da9cce7fb0a8c91e0478a6e09 Mon Sep 17 00:00:00 2001 From: Gurram Karthik Date: Sun, 22 Dec 2024 10:17:31 +0530 Subject: [PATCH 09/10] decreased time --- src/setupTests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/setupTests.ts b/src/setupTests.ts index 1aa46e722f..d204b3ddc9 100644 --- a/src/setupTests.ts +++ b/src/setupTests.ts @@ -32,4 +32,4 @@ jestPreviewConfigure({ autoPreview: true, }); -jest.setTimeout(100000); +jest.setTimeout(18000); From fb66d91ff87f36253cba910e9435215d80c276b0 Mon Sep 17 00:00:00 2001 From: Gurram Karthik Date: Sun, 22 Dec 2024 10:44:03 +0530 Subject: [PATCH 10/10] changed in event calendar --- src/components/EventCalendar/EventCalendar.tsx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/components/EventCalendar/EventCalendar.tsx b/src/components/EventCalendar/EventCalendar.tsx index c50b1ea1e6..ebcf8be942 100644 --- a/src/components/EventCalendar/EventCalendar.tsx +++ b/src/components/EventCalendar/EventCalendar.tsx @@ -139,7 +139,9 @@ const Calendar: React.FC = ({ 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.`); + } return false; } const holidayMonth = dayjs(holiday.date, 'MM-DD', true).month(); @@ -270,6 +272,11 @@ const Calendar: React.FC = ({ (windowWidth <= 700 && allDayEventsList.length > 0) ); }, [allDayEventsList.length, windowWidth]); + + const handleExpandClick: () => void = () => { + toggleExpand(-100); + }; + return ( <>
@@ -314,7 +321,7 @@ const Calendar: React.FC = ({ {Array.isArray(allDayEventsList) && (