diff --git a/zhixing-web/src/app/layout/app-layout.tsx b/zhixing-web/src/app/layout/app-layout.tsx new file mode 100644 index 0000000..e4b6fbc --- /dev/null +++ b/zhixing-web/src/app/layout/app-layout.tsx @@ -0,0 +1,282 @@ +import { BarChart3, Search } from "lucide-react" +import { useState } from "react" + +import { Link, Outlet, useMatchRoute } from "@tanstack/react-router" + +import { Avatar, AvatarFallback } from "@/shared/ui/avatar" +import { Button } from "@/shared/ui/button" +import { + Dialog, + DialogContent, + DialogDescription, + DialogHeader, + DialogTitle, +} from "@/shared/ui/dialog" +import { Input } from "@/shared/ui/input" +import { + type NavigationItem, + mobilePrimaryNavigation, + mobileOverflowNavigation, + primaryNavigation, + routePresentation, +} from "./navigation" + +function useActiveRoutePath() { + const matchRoute = useMatchRoute() + if (matchRoute({ to: "/selection", fuzzy: true })) return "/selection" + if (matchRoute({ to: "/", fuzzy: false })) return "/" + return "/" +} + +export function AppLayout() { + const activePath = useActiveRoutePath() + const presentation = routePresentation[activePath] ?? routePresentation["/"] + const [moreOpen, setMoreOpen] = useState(false) + + return ( +
+ +
+ +
+ +
+
+ setMoreOpen(true)} + /> + +
+ ) +} + +function DesktopSidebar({ activePath }: { activePath: string }) { + return ( + + ) +} + +function Brand() { + return ( +
+ + +
+

+ 知行量化 +

+

研究工作台

+
+
+ ) +} + +function DesktopNavItem({ + item, + active, +}: { + item: NavigationItem + active: boolean +}) { + const Icon = item.icon + if (item.to) { + return ( + +