link-stack/apps/bridge-frontend/app/_components/InternalLayout.tsx

36 lines
952 B
TypeScript
Raw Normal View History

2024-03-04 13:52:20 +01:00
"use client";
import { FC, PropsWithChildren, useState } from "react";
import { Grid } from "@mui/material";
2024-03-16 19:39:20 +01:00
import { CssBaseline } from "@mui/material";
2024-04-25 12:31:03 +02:00
import { SessionProvider } from "next-auth/react";
2024-03-16 19:39:20 +01:00
import { css, Global } from "@emotion/react";
2024-06-05 08:52:41 +02:00
import { fonts } from "@link-stack/ui";
2024-04-23 13:36:51 +02:00
import { Sidebar } from "./Sidebar";
2024-03-04 13:52:20 +01:00
export const InternalLayout: FC<PropsWithChildren> = ({ children }) => {
const [open, setOpen] = useState(true);
2024-03-16 19:39:20 +01:00
const { roboto } = fonts;
const globalCSS = css`
* {
font-family: ${roboto.style.fontFamily};
}
`;
2024-03-04 13:52:20 +01:00
return (
2024-04-25 12:31:03 +02:00
<SessionProvider>
2024-03-16 19:39:20 +01:00
<Global styles={globalCSS} />
<CssBaseline />
<Grid container direction="row">
<Sidebar open={open} setOpen={setOpen} />
<Grid
item
2024-04-23 13:36:51 +02:00
sx={{ ml: open ? "270px" : "70px", width: "100%", height: "100vh" }}
2024-03-16 19:39:20 +01:00
>
{children as any}
</Grid>
2024-03-04 13:52:20 +01:00
</Grid>
2024-04-25 12:31:03 +02:00
</SessionProvider>
2024-03-04 13:52:20 +01:00
);
};