Skip to content

Commit 55f11d5

Browse files
committed
a
1 parent d30462c commit 55f11d5

File tree

4 files changed

+5
-27
lines changed

4 files changed

+5
-27
lines changed

packages/nextra-theme/src/index.tsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ import { ReactElement, useCallback, useMemo } from 'react'
88
import { useSet } from 'react-use'
99
import { ThemeUICSSObject } from 'theme-ui'
1010

11-
import { Divider, DividerProps, Flex, Icon, Spacing, useI18n } from '@edgeandnode/gds'
12-
import { NPSForm } from '@edgeandnode/go'
11+
import { Divider, DividerProps, Flex, Spacing, useI18n } from '@edgeandnode/gds'
1312

1413
import {
1514
Callout,
@@ -65,16 +64,14 @@ const mdxStyles: ThemeUICSSObject = {
6564

6665
export { Heading, Image, LinkInline, Paragraph }
6766

68-
export default function NextraLayout({ children, pageOpts, pageProps }: NextraThemeLayoutProps): ReactElement {
67+
export default function NextraLayout({ children, pageOpts }: NextraThemeLayoutProps): ReactElement {
6968
const { frontMatter, filePath, pageMap, headings, title } = pageOpts
7069
const { locale, defaultLocale } = useI18n<any>()
7170
const fsPath = useFSRoute()
7271

7372
const args = useMemo(() => {
7473
const result = normalizePages({
7574
list: pageMap,
76-
locale,
77-
defaultLocale: defaultLocale,
7875
route: fsPath,
7976
})
8077

@@ -98,7 +95,7 @@ export default function NextraLayout({ children, pageOpts, pageProps }: NextraTh
9895
(item) => item.type !== 'separator' && item.type !== 'heading' && item.route !== '',
9996
),
10097
}
101-
}, [defaultLocale, fsPath, locale, pageMap])
98+
}, [fsPath, pageMap])
10299

103100
// Provide `markOutlineItem` to the `DocumentContext` so child `Heading` components can mark outline items as "in or above view" or not
104101
const [
@@ -140,6 +137,7 @@ export default function NextraLayout({ children, pageOpts, pageProps }: NextraTh
140137
}
141138

142139
return (
140+
// @ts-expect-error TODO: pageProps
143141
<NavContext.Provider value={{ filePath: pageProps.remoteFilePath || filePath, ...args }}>
144142
<DocumentContext.Provider value={{ frontMatter, headings, markOutlineItem, highlightedOutlineItemId }}>
145143
<NextSeo {...seo} />

website/next.config.js

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,9 @@ const env = {
1515
const withNextra = nextra({
1616
theme: '@graphprotocol/nextra-theme',
1717
staticImage: true,
18-
flexsearch: false,
18+
search: false,
1919
codeHighlight: false,
2020
defaultShowCopyCode: false,
21-
transform(result, { route }) {
22-
if (route && !result.includes('getStaticProps')) {
23-
const banner = `
24-
import { getPageMap } from '@/src/getPageMap'
25-
26-
export const getStaticProps = async context => ({
27-
props: {
28-
__nextra_pageMap: await getPageMap('${route.split('/')[1]}')
29-
}
30-
})`
31-
result += banner
32-
}
33-
34-
return result
35-
},
3621
})
3722

3823
export default withNextra({

website/pages/_app.mdx

Lines changed: 0 additions & 5 deletions
This file was deleted.
File renamed without changes.

0 commit comments

Comments
 (0)