diff --git a/.babelrc b/.babelrc
deleted file mode 100644
index 4a76d03..0000000
--- a/.babelrc
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "presets": [
- "next/babel",
- "@zeit/next-typescript/babel"
- ]
-}
diff --git a/.eslintrc.yml b/.eslintrc.yml
deleted file mode 100644
index c6c6944..0000000
--- a/.eslintrc.yml
+++ /dev/null
@@ -1,20 +0,0 @@
-env:
- browser: true
- es6: true
-extends:
- - plugin:prettier/recommended
- - prettier/@typescript-eslint
-globals:
- Atomics: readonly
- SharedArrayBuffer: readonly
-parser:
- '@typescript-eslint/parser'
-parserOptions:
- ecmaFeatures:
- jsx: true
- ecmaVersion: 2018
- sourceType: module
-plugins:
- - react
- - '@typescript-eslint'
-rules: {}
diff --git a/next-env.d.ts b/next-env.d.ts
new file mode 100644
index 0000000..2620bff
--- /dev/null
+++ b/next-env.d.ts
@@ -0,0 +1,8 @@
+///
+///
+declare module "@mdx-js/react" {
+ let MDXProvider: React.FC<{
+ components?: object;
+ childlen?: ReactNode;
+ }>;
+}
diff --git a/next.config.js b/next.config.js
index 8cec44d..00a5cc5 100644
--- a/next.config.js
+++ b/next.config.js
@@ -1,14 +1,5 @@
-const withTypescript = require("@zeit/next-typescript");
-const withMDX = require("@zeit/next-mdx");
-
-module.exports = [
- [
- withMDX({
- extension: /\.mdx?$/
- }),
- {
- pageExtensions: ["md", "mdx"]
- }
- ],
- [withTypescript]
-].reduce((o, [f, a]) => f(Object.assign(o, a)), {});
+module.exports = require("@next/mdx")({
+ extension: /\.mdx?$/
+})({
+ pageExtensions: ["ts", "tsx", "md", "mdx"]
+});
diff --git a/package.json b/package.json
index bff139f..b500659 100644
--- a/package.json
+++ b/package.json
@@ -5,28 +5,20 @@
"license": "MIT",
"private": true,
"dependencies": {
- "@material-ui/core": "^4.0.1",
- "@material-ui/icons": "^4.0.1",
- "@material-ui/styles": "^4.0.1",
- "@zeit/next-mdx": "^1.2.0",
- "@zeit/next-typescript": "^1.1.1",
- "next": "^8.1.0",
+ "@material-ui/core": "^4.2.0",
+ "@material-ui/icons": "^4.2.1",
+ "@material-ui/styles": "^4.2.0",
+ "@mdx-js/loader": "^1.0.21",
+ "@next/mdx": "^9.0.0",
+ "next": "^9.0.0",
"react": "^16.8.6",
- "react-dom": "^16.8.6",
- "typescript": "^3.5.1"
+ "react-dom": "^16.8.6"
},
"devDependencies": {
- "@types/next": "^8.0.5",
- "@types/react": "^16.8.19",
- "@typescript-eslint/eslint-plugin": "^1.9.0",
- "eslint": "^5.16.0",
- "eslint-config-prettier": "^4.3.0",
- "eslint-plugin-prettier": "^3.1.0",
- "eslint-plugin-react": "^7.13.0",
- "prettier": "^1.17.1"
+ "@types/node": "^12.6.1",
+ "typescript": "^3.5.3"
},
"scripts": {
- "dev": "next",
- "lint": "eslint --ext .js,.jsx,.ts,.tsx ."
+ "dev": "next"
}
}
diff --git a/pages/_document.tsx b/pages/_document.tsx
index 79b6d8d..397f091 100644
--- a/pages/_document.tsx
+++ b/pages/_document.tsx
@@ -1,16 +1,48 @@
import React from "react";
-import Document, { Head, Main, NextScript } from "next/document";
-
+import Document, {
+ DocumentContext,
+ DocumentInitialProps,
+ Html,
+ Head,
+ Main,
+ NextScript
+} from "next/document";
+import { ServerStyleSheets } from "@material-ui/styles";
+import { theme } from "../styles/MainTheme";
export default class extends Document {
+ static getInitialProps = async (ctx: DocumentContext) => {
+ const sheets = new ServerStyleSheets();
+ const originalRenderPage = ctx.renderPage;
+ ctx.renderPage = () =>
+ originalRenderPage({
+ enhanceApp: App => props => sheets.collect()
+ });
+ const initialProps = await Document.getInitialProps(ctx);
+ return {
+ ...initialProps,
+ styles: [initialProps.styles, sheets.getStyleElement()]
+ } as DocumentInitialProps;
+ };
+
render() {
return (
-
-
-
+