-
-
Notifications
You must be signed in to change notification settings - Fork 556
/
Copy pathlayout.tsx
69 lines (62 loc) · 1.58 KB
/
layout.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/* SPDX-FileCopyrightText: 2014-present Kriasoft */
/* SPDX-License-Identifier: MIT */
import { Box, GlobalStyles } from "@mui/joy";
import { Fragment, Suspense } from "react";
import { Outlet } from "react-router-dom";
import { Logo } from "./logo";
import { Sidebar } from "./sidebar";
import { Toolbar } from "./toolbar";
/**
* The main application layout.
*/
export function MainLayout(): JSX.Element {
return (
<Fragment>
<GlobalStyles
styles={{
"#root": {
display: "grid",
gridTemplateColumns: "auto 1fr",
gridTemplateRows: "auto 1fr",
height: "100dvh",
},
}}
/>
<Toolbar sx={{ gridArea: "1 / 2 / 2 / -1" }} />
<Sidebar sx={{ gridArea: "1 / 1 / -1 / 2" }} />
<Logo sx={{ gridArea: "1 / 1 / 2 / 2", zIndex: 100 }} />
<Box sx={{ gridArea: "1 / 2 / -1 / -1", pt: "60px" }}>
<Suspense>
<Outlet />
</Suspense>
</Box>
</Fragment>
);
}
/**
* The minimal app layout to be used on pages such Login/Signup,
* Privacy Policy, Terms of Use, etc.
*/
export function BaseLayout(): JSX.Element {
return (
<Fragment>
<GlobalStyles
styles={{
"#root": {
display: "grid",
gridTemplateColumns: "1fr",
minHeight: "100vh",
},
}}
/>
<Box sx={{ gridArea: "1 / 1 / 2 / 2 " }}>
<Logo />
</Box>
<Box sx={{ gridArea: "1 / 1 / -1 / -1", pt: "60px" }}>
<Suspense>
<Outlet />
</Suspense>
</Box>
</Fragment>
);
}