Skip to content
This repository was archived by the owner on Apr 13, 2023. It is now read-only.

Commit d2cfacc

Browse files
authored
Remove tsapibox data from pageContext (#128)
* Remove tsapibox data from context * Publish - [email protected]
1 parent 038164a commit d2cfacc

File tree

6 files changed

+9
-19
lines changed

6 files changed

+9
-19
lines changed

packages/gatsby-theme-apollo-docs/gatsby-node.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,6 @@ exports.createPages = async (
227227
spectrumHandle,
228228
spectrumPath,
229229
twitterHandle,
230-
typescriptApiBox,
231230
localVersion,
232231
baseUrl
233232
}
@@ -362,7 +361,6 @@ exports.createPages = async (
362361
spectrumHandle &&
363362
getSpectrumUrl(spectrumHandle) + (spectrumPath || repoPath),
364363
twitterHandle,
365-
typescriptApiBox,
366364
versions: versionKeys, // only need to send version labels to client
367365
defaultVersion,
368366
baseUrl

packages/gatsby-theme-apollo-docs/index.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
export {
2-
TypescriptApiBox,
3-
TypescriptApiBoxContext
4-
} from './src/components/typescript-api-box';
1+
export {TypescriptApiBox} from './src/components/typescript-api-box';
52
export {MultiCodeBlock} from './src/components/multi-code-block';
63
export {
74
ExpansionPanel,

packages/gatsby-theme-apollo-docs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "gatsby-theme-apollo-docs",
3-
"version": "4.2.11",
3+
"version": "4.3.0-alpha.0",
44
"main": "index.js",
55
"description": "A Gatsby theme for building documentation websites",
66
"author": "Trevor Blades <[email protected]>",

packages/gatsby-theme-apollo-docs/src/components/template.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import rehypeReact from 'rehype-react';
1010
import styled from '@emotion/styled';
1111
import {ContentWrapper, colors, smallCaps} from 'gatsby-theme-apollo-core';
1212
import {MDXProvider} from '@mdx-js/react';
13-
import {TypescriptApiBoxContext} from './typescript-api-box';
1413
import {graphql, navigate} from 'gatsby';
1514

1615
const StyledContentWrapper = styled(ContentWrapper)({
@@ -130,7 +129,6 @@ export default function Template(props) {
130129
sidebarContents,
131130
githubUrl,
132131
spectrumUrl,
133-
typescriptApiBox,
134132
twitterHandle,
135133
baseUrl
136134
} = props.pageContext;
@@ -169,11 +167,9 @@ export default function Template(props) {
169167
}}
170168
>
171169
{file.childMdx ? (
172-
<TypescriptApiBoxContext.Provider value={typescriptApiBox}>
173-
<MDXProvider components={components}>
174-
<MDXRenderer>{file.childMdx.body}</MDXRenderer>
175-
</MDXProvider>
176-
</TypescriptApiBoxContext.Provider>
170+
<MDXProvider components={components}>
171+
<MDXRenderer>{file.childMdx.body}</MDXRenderer>
172+
</MDXProvider>
177173
) : (
178174
renderAst(file.childMarkdownRemark.htmlAst)
179175
)}

packages/gatsby-theme-apollo-docs/src/components/typescript-api-box.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import PropTypes from 'prop-types';
2-
import React, {Component, Fragment, createContext} from 'react';
2+
import React, {Component, Fragment} from 'react';
3+
import docs from '../docs.json';
34
import extend from 'lodash/extend';
45
import partition from 'lodash/partition';
56
import remark from 'remark';
@@ -129,7 +130,7 @@ export class TypescriptApiBox extends Component {
129130
}
130131
}
131132

132-
traverse(this.context.data);
133+
traverse(docs);
133134

134135
return dataByKey;
135136
}
@@ -439,6 +440,3 @@ export class TypescriptApiBox extends Component {
439440
);
440441
}
441442
}
442-
443-
export const TypescriptApiBoxContext = createContext();
444-
TypescriptApiBox.contextType = TypescriptApiBoxContext;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

0 commit comments

Comments
 (0)