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

Function TopBar

src/Components/TopBar/TopBar.jsx:14–57  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

12import {useSmallPage} from "../common";
13
14function TopBar() {
15 const navigate = useNavigate();
16 const user = useUser()
17 const smallPage = useSmallPage();
18
19 const theme = useTheme();
20 const darkMode = theme.palette.mode === 'dark';
21 return (
22 <AppBar position='sticky'
23 elevation={0}
24 sx={{
25 bgcolor: (theme) => theme.palette.mode === 'dark' ? 'rgba(15, 19, 24, 0.8)' : 'rgba(236, 241, 249, 0.8)',
26 color: (theme) => theme.palette.text.primary,
27 backdropFilter: 'blur(12px)',
28 WebkitBackdropFilter: 'blur(12px)',
29 borderBottom: (theme) => `1px solid ${theme.palette.divider}`,
30 display: "block",
31 zIndex: (theme) => theme.zIndex.drawer + 1,
32 }}>
33 <Toolbar className="TopBar" sx={{
34 p: (smallPage ? 0 : 'auto'),
35 minHeight: '60px',
36 '@media (min-width:600px)': {
37 minHeight: '60px',
38 },
39 }}>
40 <SvgIcon
41 component={darkMode ? (smallPage ? DarkShortIcon : DarkIcon) : (smallPage ? LightShortIcon : LightIcon)}
42 inheritViewBox
43 onClick={() => navigate(user === null ? "/login" : "/")}
44 sx={{
45 height: "40px",
46 width: (smallPage ? "40px" : "auto"),
47 pl: (smallPage ? "8px" : 0),
48 fontSize: '10em',
49 cursor: 'pointer',
50 }}
51 />
52 <NavBar/>
53 <StatusBlock/>
54 </Toolbar>
55 </AppBar>
56 );
57}
58
59export default TopBar;

Callers

nothing calls this directly

Calls 2

useUserFunction · 0.90
useSmallPageFunction · 0.90

Tested by

no test coverage detected