diff --git a/frontend/src/routes/__root.tsx b/frontend/src/routes/__root.tsx index a56692b..4db16c4 100644 --- a/frontend/src/routes/__root.tsx +++ b/frontend/src/routes/__root.tsx @@ -1,5 +1,5 @@ import { useEffect, useState } from 'react' -import { createRootRoute, Link, Outlet } from '@tanstack/react-router' +import { createRootRoute, Link, Outlet, useRouterState } from '@tanstack/react-router' import { useTranslation } from 'react-i18next' import { Menu, Radio, X } from 'lucide-react' import { useAuthStore } from '@/features/auth/store' @@ -17,6 +17,10 @@ function RootLayout() { const { theme, setTheme } = useTheme() const [menuOpen, setMenuOpen] = useState(false) + // Админка — с таблицами; ей даём больше ширины, публичные страницы оставляем компактными. + const pathname = useRouterState({ select: (s) => s.location.pathname }) + const containerMax = pathname.startsWith('/admin') ? 'max-w-screen-2xl' : 'max-w-5xl' + useEffect(() => { void bootstrapSession() }, []) @@ -32,7 +36,7 @@ function RootLayout() { return (