-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathLayout.tsx
35 lines (31 loc) · 803 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
34
35
import { createStyles, makeStyles, Theme } from "@material-ui/core/styles"
import Head from "next/head"
import React from "react"
import { usePage } from "../../hooks"
import { ResponsiveDrawer } from "../organisms"
const useStyles = makeStyles((_: Theme) =>
createStyles({
root: {
height: "100%",
},
})
)
type Props = {
children: React.ReactNode
className?: string
}
export const Layout = function (props: Props) {
const { children, className } = props
const classes = useStyles(props)
const { selectedPage } = usePage()
return (
<section className={`${classes.root} ${className}`}>
<Head>
<title>{selectedPage.title}</title>
</Head>
<ResponsiveDrawer>
<article>{children}</article>
</ResponsiveDrawer>
</section>
)
}