From 0cb8747e096874f1c99d4f8f6bc1991a4c6326e4 Mon Sep 17 00:00:00 2001 From: Louis Mazin Date: Fri, 25 Sep 2026 16:05:56 +0200 Subject: [PATCH] test --- frontend/src/pages/CalendarPage.jsx | 101 ++-------------------------- 1 file changed, 5 insertions(+), 96 deletions(-) diff --git a/frontend/src/pages/CalendarPage.jsx b/frontend/src/pages/CalendarPage.jsx index d92a32c..f651524 100644 --- a/frontend/src/pages/CalendarPage.jsx +++ b/frontend/src/pages/CalendarPage.jsx @@ -1,6 +1,5 @@ import React, { useEffect, - useLayoutEffect, useMemo, useRef, useState, @@ -113,8 +112,6 @@ const CalendarPage = () => { ); const [isMobile, setIsMobile] = useState(false); - const [availableHeight, setAvailableHeight] = - useState(600); const [events, setEvents] = useState([]); const [loadingEvents, setLoadingEvents] = @@ -162,7 +159,6 @@ const CalendarPage = () => { end_time: '', color: DEFAULT_EVENT_COLOR, }); - const calendarRef = useRef(null); /* SÉLECTION D'UNE PÉRIODE */ const [selectionStart, setSelectionStart] = useState(null); const [selectionEnd, setSelectionEnd] = useState(null); @@ -434,70 +430,6 @@ const CalendarPage = () => { useEffect(() => { if (isMobile) clearSelection(); }, [isMobile]); - /* - * ============================================================ - * DIMENSIONS CALENDRIER - * ============================================================ - */ - useLayoutEffect(() => { - if (loadingEvents) return; - const updateDimensions = () => { - const calendar = - calendarRef.current; - if (!calendar) return; - const cardContent = - calendar.closest( - '[data-slot="card-content"]', - ); - if (!cardContent) return; - const calendarTop = - calendar.getBoundingClientRect() - .top; - const contentRect = - cardContent.getBoundingClientRect(); - const footer = - document.querySelector('footer'); - const footerTop = footer - ? footer.getBoundingClientRect() - .top - : window.innerHeight; - const bottom = Math.min( - contentRect.bottom, - footerTop, - window.innerHeight, - ); - const height = - bottom - calendarTop - 4; - setAvailableHeight( - Math.max(300, height), - ); - }; - updateDimensions(); - window.addEventListener( - 'resize', - updateDimensions, - ); - let observer = null; - if ( - typeof ResizeObserver !== - 'undefined' && - calendarRef.current - ) { - observer = new ResizeObserver( - updateDimensions, - ); - observer.observe( - calendarRef.current, - ); - } - return () => { - window.removeEventListener( - 'resize', - updateDimensions, - ); - observer?.disconnect(); - }; - }, [year, selectedMonth, isMobile, loadingEvents]); /* * ============================================================ * ANNÉE @@ -955,16 +887,6 @@ const CalendarPage = () => { ? getDaysInMonth(selectedMonth) : 31; - const availableGridHeight = Math.max( - availableHeight - HEADER_HEIGHT, - rowCount * MIN_ROW_HEIGHT, - ); - - const rowHeight = Math.max( - MIN_ROW_HEIGHT, - availableGridHeight / rowCount, - ); - const minimumGridWidth = isMobile ? 0 : DAY_COLUMN_WIDTH + @@ -1464,7 +1386,6 @@ const CalendarPage = () => { )}
{ }} >
{ text-xs font-medium text-muted-foreground " - style={{ - height: `${rowHeight}px`, - }} > {day}
@@ -1590,9 +1503,6 @@ const CalendarPage = () => { border-b border-r border-border bg-transparent " - style={{ - height: `${rowHeight}px`, - }} /> ); } @@ -1656,7 +1566,6 @@ const CalendarPage = () => { `} data-calendar-date={cellDate} style={{ - height: `${rowHeight}px`, overflow: 'visible', }} @@ -1812,8 +1721,8 @@ const CalendarPage = () => { rounded-full " style={{ - width: `${Math.min(12, Math.max(6, rowHeight * 0.9))}px`, - height: `${Math.min(12, Math.max(6, rowHeight * 0.9))}px`, + width: '12px', + height: '12px', backgroundColor: eventColor, }} onPointerDown={(pointerEvent) => {