Skip to content

Commit 80b8efb

Browse files
committedMay 4, 2021
Fixed window undefined
1 parent 476d6d6 commit 80b8efb

File tree

5 files changed

+8
-41
lines changed

5 files changed

+8
-41
lines changed
 

‎website/gatsby-node.js

-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ const path = require(`path`);
33

44
exports.createPages = async ({ actions, graphql, reporter }) => {
55
const { createPage, createRedirect } = actions;
6-
const blogArticleTemplate = path.resolve(
7-
`src/templates/blog-article-template.tsx`
8-
);
96
const result = await graphql(`
107
{
118
blog: allMdx(

‎website/mdx.types.ts

+6-30
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,10 @@
11
declare module "@mdx-js/react" {
2-
import * as React from "react";
3-
type ComponentType =
4-
| "a"
5-
| "blockquote"
6-
| "code"
7-
| "del"
8-
| "em"
9-
| "h1"
10-
| "h2"
11-
| "h3"
12-
| "h4"
13-
| "h5"
14-
| "h6"
15-
| "hr"
16-
| "img"
17-
| "inlineCode"
18-
| "li"
19-
| "ol"
20-
| "p"
21-
| "pre"
22-
| "strong"
23-
| "sup"
24-
| "table"
25-
| "td"
26-
| "thematicBreak"
27-
| "tr"
28-
| "ul";
2+
import { Component, ComponentType, ReactNode } from "react";
3+
294
export interface MDXProviderProps {
30-
children: React.ReactNode;
31-
components: Record<any, React.ComponentType<any>>;
5+
children: ReactNode;
6+
components: Record<any, ComponentType<any>>;
327
}
33-
export class MDXProvider extends React.Component<MDXProviderProps> {}
8+
9+
export class MDXProvider extends Component<MDXProviderProps> {}
3410
}

‎website/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@
6161
"react-redux": "^7.2.1",
6262
"react-responsive-carousel": "^3.2.11",
6363
"react-share": "^4.2.1",
64-
"redux-devtools-extension": "^2.13.9",
6564
"styled-components": "^5.2.3"
6665
},
6766
"devDependencies": {

‎website/src/state/state.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export default function createStore(preloadedState: State) {
1313
return createReduxStore(
1414
rootReducer,
1515
preloadedState,
16-
(window as any).__REDUX_DEVTOOLS_EXTENSION__ &&
17-
(window as any).__REDUX_DEVTOOLS_EXTENSION__()
16+
typeof window === "object" &&
17+
(window as any).__REDUX_DEVTOOLS_EXTENSION__?.()
1818
);
1919
}

‎website/yarn.lock

-5
Original file line numberDiff line numberDiff line change
@@ -16038,11 +16038,6 @@ redent@^1.0.0:
1603816038
indent-string "^2.1.0"
1603916039
strip-indent "^1.0.1"
1604016040

16041-
redux-devtools-extension@^2.13.9:
16042-
version "2.13.9"
16043-
resolved "https://registry.yarnpkg.com/redux-devtools-extension/-/redux-devtools-extension-2.13.9.tgz#6b764e8028b507adcb75a1cae790f71e6be08ae7"
16044-
integrity sha512-cNJ8Q/EtjhQaZ71c8I9+BPySIBVEKssbPpskBfsXqb8HJ002A3KRVHfeRzwRo6mGPqsm7XuHTqNSNeS1Khig0A==
16045-
1604616041
redux-thunk@^2.3.0:
1604716042
version "2.3.0"
1604816043
resolved "https://registry.yarnpkg.com/redux-thunk/-/redux-thunk-2.3.0.tgz#51c2c19a185ed5187aaa9a2d08b666d0d6467622"

0 commit comments

Comments
 (0)
Please sign in to comment.