feat(ui): unify header bar into a single route-aware component in __root.tsx

This commit is contained in:
yiling
2026-05-24 11:18:40 +08:00
parent 0d8eba3b85
commit 8b1e86c41a
5 changed files with 192 additions and 87 deletions
+9 -5
View File
@@ -15,6 +15,7 @@ import {
} from '@tanstack/react-router'
import { HomeIcon } from 'lucide-react'
import { useEffect } from 'react'
import { TopNav } from '@/ui/components/top-nav'
function RootComponent() {
const user = useAuthStore((state) => state.user)
@@ -47,7 +48,7 @@ function RootComponent() {
}, [teamId, projectId, setTeamId, ensureTeamIdForProject])
return (
<>
<div className="flex h-screen w-full bg-background overflow-hidden">
<Toaster />
<DualSidebar>
<DualSidebarItem
@@ -77,10 +78,13 @@ function RootComponent() {
<UploadTasks />
</DualSidebarItem>
</DualSidebar>
<main className="md:pl-16">
<Outlet />
</main>
</>
<div className="flex flex-col flex-1 md:pl-16 overflow-hidden relative">
<TopNav />
<main className="flex-1 overflow-hidden relative">
<Outlet />
</main>
</div>
</div>
)
}