MCPcopy Create free account
hub / github.com/OpenSIST/OpenSIST.github.io / NavBar

Function NavBar

src/Components/TopBar/NavBar/NavBar.jsx:26–70  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

24}
25
26export default function NavBar() {
27 const navItems = [
28 {
29 name: "首页",
30 path: "/",
31 }, {
32 name: "申请季数据汇总",
33 path: "/datapoints",
34 }, {
35 name: "项目信息表",
36 path: "/programs",
37 }, {
38 name: "经验分享帖",
39 path: "/posts",
40 }, {
41 name: "帮助中心",
42 path: "/FAQ",
43 }
44 ]
45 const routeMatch = useRouteMatch(navItems.map((item) => item.path));
46 const currentTab = routeMatch ?? false;
47
48 if (!useUser()) {
49 return null;
50 }
51 return (
52 <Tabs
53 value={currentTab}
54 variant="scrollable"
55 scrollButtons
56 allowScrollButtonsMobile
57 role="navigation"
58 >
59 {navItems.map((item, index) => (
60 <Tab
61 key={index}
62 label={item.name}
63 value={item.path}
64 to={item.path}
65 component={Link}
66 />
67 ))}
68 </Tabs>
69 );
70}

Callers

nothing calls this directly

Calls 2

useUserFunction · 0.90
useRouteMatchFunction · 0.85

Tested by

no test coverage detected