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

29 lines
722 B
TypeScript
Raw Normal View History

2023-08-07 13:36:59 +00:00
import { Box, 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
2023-08-02 08:31:58 +00:00
import type { ReactNode } from "react";
2022-11-21 17:53:16 +00:00
interface Props {
children: ReactNode;
2022-11-21 17:53:16 +00:00
}
export default function Navbar({ children }: Props) {
const theme = useTheme();
const upMd = useMediaQuery(theme.breakpoints.up(1000));
2022-11-21 17:53:16 +00:00
return (
<Box
sx={{
paddingTop: upMd ? "80px" : 0,
width: "100%",
}}
>
{upMd ? (
<NavbarFull>{children}</NavbarFull>
) : (
<NavbarCollapsed>{children}</NavbarCollapsed>
)}
</Box>
);
2023-03-27 12:45:44 +00:00
}