fix family screen adaptation

This commit is contained in:
lendry
2026-06-27 23:27:32 +03:00
parent ee28a7b1db
commit 923a028cdd
2 changed files with 6 additions and 5 deletions

View File

@@ -1,6 +1,7 @@
'use client';
import Link from 'next/link';
import { usePathname } from 'next/navigation';
import { FileText, Heart, Home, LockKeyhole, LogOut, ShieldCheck, UserRound } from 'lucide-react';
import { FamilySidebarPanel } from '@/components/family/family-sidebar-panel';
import { BrandLogo } from '@/components/id/brand-logo';
@@ -18,6 +19,8 @@ const baseItems = [
export function Sidebar({ active }: { active: string }) {
const { logout, user } = useAuth();
const pathname = usePathname();
const onFamilyChatPage = Boolean(pathname && /^\/family\/[^/]+$/.test(pathname));
const items = user?.canAccessAdmin
? [...baseItems, { href: getAdminLandingPath(user), label: 'Админка', icon: ShieldCheck }]
: baseItems;
@@ -44,7 +47,7 @@ export function Sidebar({ active }: { active: string }) {
))}
</nav>
<div className="min-h-0 flex-1 overflow-hidden">
<FamilySidebarPanel />
{!onFamilyChatPage ? <FamilySidebarPanel /> : null}
</div>
</div>
</aside>