diff --git a/frontend/src/components/AppShell.tsx b/frontend/src/components/AppShell.tsx index 59c416c9..d432ada9 100644 --- a/frontend/src/components/AppShell.tsx +++ b/frontend/src/components/AppShell.tsx @@ -10,6 +10,7 @@ import { useNotifications } from "@/hooks/useApi"; import { getVerbCategory } from "@/lib/verbTranslations"; import { NotificationCenter, NotificationPanel } from "@/components/NotificationCenter"; import { CalendarSidebar } from "@/components/calendar/CalendarSidebar"; +import { DesktopStickyRail } from "@/components/layout/DesktopStickyRail"; import { useCalendarModals } from "@/hooks/useCalendarModals"; import { CalendarModals } from "@/components/layout/CalendarModals"; import { MobileLeftDrawer, MobileCalendarDrawer } from "@/components/layout/MobileDrawers"; @@ -339,17 +340,13 @@ function LeftNavContent({ onNavigate }: LeftNavContentProps) { ); } -function LeftNav({ fixedDesktop = false }: { fixedDesktop?: boolean }) { +function LeftNav({ pinnedDesktop = true }: { pinnedDesktop?: boolean }) { return ( - + ); } @@ -459,7 +456,7 @@ export function AppShell({ children }: AppShellProps) { onOpenCalendar={() => setIsMobileCalendarOpen(true)} />
- +
{children}
diff --git a/frontend/src/components/calendar/CalendarSidebar.tsx b/frontend/src/components/calendar/CalendarSidebar.tsx index 26c5abbc..10c8d5b7 100644 --- a/frontend/src/components/calendar/CalendarSidebar.tsx +++ b/frontend/src/components/calendar/CalendarSidebar.tsx @@ -2,6 +2,7 @@ import { memo } from "react"; import { CalendarCard } from "@/components/calendar/CalendarCard"; +import { DesktopStickyRail } from "@/components/layout/DesktopStickyRail"; import type { CalendarEvent } from "@/services/calendarService"; interface CalendarSidebarProps { @@ -15,23 +16,19 @@ interface CalendarSidebarProps { setEventsRefreshTrigger: (value: number | ((prev: number) => number)) => void; setSidebarEvents: (events: CalendarEvent[]) => void; onCalendarChange: (calendarId: number | null) => void; - fixedDesktop?: boolean; + pinnedDesktop?: boolean; } /** * Обертка для календаря в правом сайдбаре (десктоп) */ export const CalendarSidebar = memo(function CalendarSidebar(props: CalendarSidebarProps) { - const { fixedDesktop = false, ...calendarProps } = props; + const { pinnedDesktop = true, ...calendarProps } = props; return ( - + ); }); diff --git a/frontend/src/components/layout/DesktopStickyRail.tsx b/frontend/src/components/layout/DesktopStickyRail.tsx new file mode 100644 index 00000000..86a2778f --- /dev/null +++ b/frontend/src/components/layout/DesktopStickyRail.tsx @@ -0,0 +1,25 @@ +"use client"; + +import type { ReactNode } from "react"; + +type DesktopStickyRailProps = { + widthClass: string; + pinned?: boolean; + children: ReactNode; +}; + +export function DesktopStickyRail({ widthClass, pinned = true, children }: DesktopStickyRailProps) { + return ( + + ); +}