diff --git a/webapp-next/src/components/CalendarPage.tsx b/webapp-next/src/components/CalendarPage.tsx index 162a267..0752db9 100644 --- a/webapp-next/src/components/CalendarPage.tsx +++ b/webapp-next/src/components/CalendarPage.tsx @@ -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) { > diff --git a/webapp-next/src/components/calendar/CalendarHeader.tsx b/webapp-next/src/components/calendar/CalendarHeader.tsx index ccda356..c11df6a 100644 --- a/webapp-next/src/components/calendar/CalendarHeader.tsx +++ b/webapp-next/src/components/calendar/CalendarHeader.tsx @@ -11,7 +11,6 @@ import { cn } from "@/lib/utils"; import { ChevronLeft as ChevronLeftIcon, ChevronRight as ChevronRightIcon, - RefreshCw as RefreshCwIcon, } from "lucide-react"; export interface CalendarHeaderProps { @@ -19,31 +18,14 @@ export interface CalendarHeaderProps { month: Date; /** Whether month navigation is disabled (e.g. during loading). */ disabled?: boolean; - /** When true, show a compact loading spinner next to the month title (e.g. while fetching new month). */ - isLoading?: boolean; - /** When provided and displayed month is not the current month, show a "Today" control that calls this. */ - onGoToToday?: () => void; - /** When provided, show a refresh icon that calls this (e.g. to refetch month data). */ - onRefresh?: () => void; onPrevMonth: () => void; onNextMonth: () => void; className?: string; } -function isCurrentMonth(month: Date): boolean { - const now = new Date(); - return ( - month.getFullYear() === now.getFullYear() && - month.getMonth() === now.getMonth() - ); -} - export function CalendarHeader({ month, disabled = false, - isLoading = false, - onGoToToday, - onRefresh, onPrevMonth, onNextMonth, className, @@ -52,7 +34,6 @@ export function CalendarHeader({ const year = month.getFullYear(); const monthIndex = month.getMonth(); const labels = weekdayLabels(); - const showToday = Boolean(onGoToToday) && !isCurrentMonth(month); return (
@@ -76,44 +57,18 @@ export function CalendarHeader({ > {monthName(monthIndex)} {year} - {showToday && ( - - )} - -
- {onRefresh && ( - - )} -
+
{labels.map((label, i) => ( diff --git a/webapp-next/src/i18n/messages.ts b/webapp-next/src/i18n/messages.ts index 0674bd7..46d84e7 100644 --- a/webapp-next/src/i18n/messages.ts +++ b/webapp-next/src/i18n/messages.ts @@ -16,8 +16,6 @@ export const MESSAGES: Record> = { "error.retry": "Retry", "nav.prev_month": "Previous month", "nav.next_month": "Next month", - "nav.today": "Today", - "nav.refresh": "Refresh", "weekdays.mon": "Mon", "weekdays.tue": "Tue", "weekdays.wed": "Wed", @@ -91,8 +89,6 @@ export const MESSAGES: Record> = { "error.retry": "Повторить", "nav.prev_month": "Предыдущий месяц", "nav.next_month": "Следующий месяц", - "nav.today": "Сегодня", - "nav.refresh": "Обновить", "weekdays.mon": "Пн", "weekdays.tue": "Вт", "weekdays.wed": "Ср",