front-hub/src/components/Navbar/Navbar.tsx

16 lines
483 B
TypeScript
Raw Normal View History

2023-05-17 11:20:11 +00:00
import { useMediaQuery, useTheme } from "@mui/material";
2022-11-21 18:19:51 +00:00
import NavbarCollapsed from "./NavbarCollapsed";
import NavbarFull from "./NavbarFull";
2022-11-21 17:53:16 +00:00
interface Props {
2023-05-26 11:19:10 +00:00
isCollapsed?: boolean;
isLoggedIn: boolean;
2022-11-21 17:53:16 +00:00
}
2022-11-21 18:19:51 +00:00
export default function Navbar({ isLoggedIn, isCollapsed = false }: Props) {
2023-05-26 11:19:10 +00:00
const theme = useTheme();
const upMd = useMediaQuery(theme.breakpoints.up("md"));
2023-05-17 11:20:11 +00:00
2023-05-26 11:19:10 +00:00
return upMd ? <NavbarFull isLoggedIn={isLoggedIn} /> : <NavbarCollapsed isLoggedIn={isLoggedIn} />;
2023-03-27 12:45:44 +00:00
}