-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_layout.tsx
33 lines (31 loc) · 997 Bytes
/
_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
// deno-lint-ignore-file no-undef
import { React } from "./_deps.tsx";
import type { PagicLayout } from "./_deps.tsx";
import Head from "./_head.tsx";
import Header from "./_header.tsx";
import Sidebar from "./_sidebar.tsx";
import Main from "./_main.tsx";
import Footer from "./_footer.tsx";
import Tools from "./_tools.tsx";
import { classnames } from "./_utils.tsx";
// @ts-ignore need for parse
const Layout: PagicLayout = (props) => {
const [isDark, setIsDark] = React.useState(
window.Deno ? false : // @ts-ignore need for parse
document.documentElement.classList.contains("is_dark"),
);
return (
<html className={classnames({ is_dark: isDark })}>
<Head {...props} isDark={isDark} />
<body>
<Header {...props} isDark={isDark} setIsDark={setIsDark} />
<Sidebar {...props} />
<Main {...props} />
<Footer {...props} />
<Tools {...props} />
{props.script}
</body>
</html>
);
};
export default Layout;