From 9b63fc5230768397a50250292bc65c82901f3411 Mon Sep 17 00:00:00 2001 From: Kohei Watanabe Date: Tue, 23 Apr 2019 18:52:12 +0900 Subject: [PATCH] =?UTF-8?q?Typography=E3=81=AA=E3=81=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/_app.tsx | 2 -- pages/about.md | 3 +++ pages/about.mdx | 7 ------- pages/index.md | 3 +++ pages/index.mdx | 7 ------- styles/MainTheme.tsx | 34 +++++++++++++++++++++++++++++++--- tsconfig.json | 8 +++----- types/@mdx-js/tag.d.ts | 6 ++++++ 8 files changed, 46 insertions(+), 24 deletions(-) create mode 100644 pages/about.md delete mode 100644 pages/about.mdx create mode 100644 pages/index.md delete mode 100644 pages/index.mdx create mode 100644 types/@mdx-js/tag.d.ts diff --git a/pages/_app.tsx b/pages/_app.tsx index 9bca957..baf09d2 100644 --- a/pages/_app.tsx +++ b/pages/_app.tsx @@ -1,7 +1,6 @@ import React from "react"; import App, { Container } from "next/app"; import MainTheme from "../styles/MainTheme"; -import TopAppBar from "../styles/TopAppBar"; export default class extends App { render() { @@ -9,7 +8,6 @@ export default class extends App { return ( - diff --git a/pages/about.md b/pages/about.md new file mode 100644 index 0000000..b092323 --- /dev/null +++ b/pages/about.md @@ -0,0 +1,3 @@ +# About + +- [Back to Home](/) diff --git a/pages/about.mdx b/pages/about.mdx deleted file mode 100644 index 4a5a9da..0000000 --- a/pages/about.mdx +++ /dev/null @@ -1,7 +0,0 @@ -import Link from "next/link"; - -# About - - - Back to Home - diff --git a/pages/index.md b/pages/index.md new file mode 100644 index 0000000..1c0e5ca --- /dev/null +++ b/pages/index.md @@ -0,0 +1,3 @@ +# Hello Next.js + +- [/about](/about) diff --git a/pages/index.mdx b/pages/index.mdx deleted file mode 100644 index 7c7c44f..0000000 --- a/pages/index.mdx +++ /dev/null @@ -1,7 +0,0 @@ -import Link from "next/link"; - -# Hello Next.js - - - /about - diff --git a/styles/MainTheme.tsx b/styles/MainTheme.tsx index a6d0d3c..ce5ce3b 100644 --- a/styles/MainTheme.tsx +++ b/styles/MainTheme.tsx @@ -1,9 +1,18 @@ import "./boot"; import { ThemeProvider } from "@material-ui/styles"; -import { CssBaseline, createMuiTheme } from "@material-ui/core"; +import { + CssBaseline, + createMuiTheme, + Typography, + Link as MuiLink, + Grid +} from "@material-ui/core"; import { orange, teal } from "@material-ui/core/colors"; -import React from "react"; +import { MDXProvider } from "@mdx-js/tag"; +import React, { ReactElement } from "react"; import Head from "next/head"; +import Link from "next/link"; +import TopAppBar from "./TopAppBar"; export const theme = createMuiTheme({ palette: { @@ -20,6 +29,20 @@ export const theme = createMuiTheme({ } }); +export const components = { + h1: (props: {}) => , + h2: (props: {}) => , + h3: (props: {}) => , + h4: (props: {}) => , + h5: (props: {}) => , + h6: (props: {}) => , + a: ({ href, ...props }: { href: string }) => ( + + + + ) +}; + const MainTheme: React.FC<{}> = ({ children }) => ( @@ -34,7 +57,12 @@ const MainTheme: React.FC<{}> = ({ children }) => ( /> - {children} + + + + {children} + + ); export default MainTheme; diff --git a/tsconfig.json b/tsconfig.json index 4e57187..b48a52d 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,10 +3,7 @@ "allowJs": true, "allowSyntheticDefaultImports": true, "jsx": "preserve", - "lib": [ - "dom", - "es2017" - ], + "lib": ["dom", "es2017"], "module": "esnext", "moduleResolution": "node", "noEmit": true, @@ -20,6 +17,7 @@ "noImplicitAny": true, "noImplicitReturns": true, "noImplicitThis": true, - "target": "esnext" + "target": "esnext", + "typeRoots": ["node_modules/@types", "types"] } } diff --git a/types/@mdx-js/tag.d.ts b/types/@mdx-js/tag.d.ts new file mode 100644 index 0000000..6cebc24 --- /dev/null +++ b/types/@mdx-js/tag.d.ts @@ -0,0 +1,6 @@ +declare module "@mdx-js/tag" { + class MDXProvider extends React.Component<{ + components: any; + childlen?: ReactNode; + }> {} +}