2019-04-23 16:48:33 +09:00
|
|
|
import "./boot";
|
|
|
|
import { ThemeProvider } from "@material-ui/styles";
|
2019-04-23 18:52:12 +09:00
|
|
|
import {
|
|
|
|
CssBaseline,
|
|
|
|
createMuiTheme,
|
|
|
|
Typography,
|
|
|
|
Link as MuiLink,
|
|
|
|
Grid
|
|
|
|
} from "@material-ui/core";
|
2019-04-23 16:48:33 +09:00
|
|
|
import { orange, teal } from "@material-ui/core/colors";
|
2019-04-23 18:52:12 +09:00
|
|
|
import { MDXProvider } from "@mdx-js/tag";
|
2019-04-23 18:55:07 +09:00
|
|
|
import React from "react";
|
2019-04-23 16:48:33 +09:00
|
|
|
import Head from "next/head";
|
2019-04-23 18:52:12 +09:00
|
|
|
import Link from "next/link";
|
|
|
|
import TopAppBar from "./TopAppBar";
|
2019-04-23 16:48:33 +09:00
|
|
|
|
|
|
|
export const theme = createMuiTheme({
|
|
|
|
palette: {
|
|
|
|
primary: {
|
|
|
|
main: orange[900]
|
|
|
|
},
|
|
|
|
secondary: {
|
|
|
|
main: teal[400]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
typography: {
|
|
|
|
useNextVariants: true,
|
|
|
|
fontFamily: '"Noto Sans JP", "Helvetica", "Arial", sans-serif'
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2019-04-23 18:52:12 +09:00
|
|
|
export const components = {
|
|
|
|
h1: (props: {}) => <Typography variant="h1" {...props} />,
|
|
|
|
h2: (props: {}) => <Typography variant="h2" {...props} />,
|
|
|
|
h3: (props: {}) => <Typography variant="h3" {...props} />,
|
|
|
|
h4: (props: {}) => <Typography variant="h4" {...props} />,
|
|
|
|
h5: (props: {}) => <Typography variant="h5" {...props} />,
|
|
|
|
h6: (props: {}) => <Typography variant="h6" {...props} />,
|
|
|
|
a: ({ href, ...props }: { href: string }) => (
|
2019-04-23 18:55:07 +09:00
|
|
|
<Link prefetch href={href}>
|
2019-04-23 18:52:12 +09:00
|
|
|
<MuiLink variant="body1" href={href} {...props} />
|
|
|
|
</Link>
|
|
|
|
)
|
|
|
|
};
|
|
|
|
|
2019-04-23 16:48:33 +09:00
|
|
|
const MainTheme: React.FC<{}> = ({ children }) => (
|
|
|
|
<ThemeProvider theme={theme}>
|
|
|
|
<Head>
|
|
|
|
<meta
|
|
|
|
name="viewport"
|
|
|
|
content="width=device-width,minimum-scale=1,initial-scale=1"
|
|
|
|
/>
|
|
|
|
<meta name="theme-color" content={theme.palette.primary.main} />
|
|
|
|
<link
|
|
|
|
rel="stylesheet"
|
|
|
|
href="https://fonts.googleapis.com/css?family=Noto+Sans+JP"
|
|
|
|
/>
|
|
|
|
</Head>
|
|
|
|
<CssBaseline />
|
2019-04-23 18:52:12 +09:00
|
|
|
<MDXProvider components={components}>
|
|
|
|
<Typography component="div" variant="body1">
|
|
|
|
<TopAppBar />
|
|
|
|
<Grid container>{children}</Grid>
|
|
|
|
</Typography>
|
|
|
|
</MDXProvider>
|
2019-04-23 16:48:33 +09:00
|
|
|
</ThemeProvider>
|
|
|
|
);
|
|
|
|
export default MainTheme;
|