fix family screen adaptation
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user