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:
@@ -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}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user