()
| 12 | import {useSmallPage} from "../common"; |
| 13 | |
| 14 | function 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 | |
| 59 | export default TopBar; |
nothing calls this directly
no test coverage detected