refactor: simplify CalendarPage and CalendarHeader components by removing unused props

- Removed the handleGoToToday function and its associated prop from CalendarPage, streamlining the component's logic.
- Eliminated the isLoading and onRefresh props from CalendarHeader, enhancing clarity and reducing complexity.
- Updated internationalization messages to remove references to "Today" and "Refresh," aligning with the component changes.
This commit is contained in:
2026-03-03 16:23:49 +03:00
parent 95f65141e1
commit 95c9e23c33
3 changed files with 11 additions and 68 deletions

View File

@@ -123,11 +123,6 @@ export function CalendarPage({ isAllowed, initDataRaw }: CalendarPageProps) {
setSelectedDay(null);
}, [setSelectedDay]);
const handleGoToToday = useCallback(() => {
setCurrentMonth(new Date());
retry();
}, [setCurrentMonth, retry]);
const readyCalledRef = useRef(false);
// Signal Telegram to hide loading when the first load finishes (loading goes true -> false).
useEffect(() => {
@@ -145,10 +140,7 @@ export function CalendarPage({ isAllowed, initDataRaw }: CalendarPageProps) {
>
<CalendarHeader
month={currentMonth}
isLoading={false}
disabled={navDisabled}
onGoToToday={handleGoToToday}
onRefresh={retry}
onPrevMonth={handlePrevMonth}
onNextMonth={handleNextMonth}
/>