Browse Source

fix: move mdx provider

fix/enable-imgix
Thomas Osmonson 5 years ago
committed by Thomas Osmonson
parent
commit
0a4b36da65
  1. 10
      src/components/app-wrapper.tsx
  2. 5
      src/components/mdx/md-contents.tsx

10
src/components/app-wrapper.tsx

@ -1,6 +1,4 @@
import React from 'react';
import { MDXProvider } from '@mdx-js/react';
import { MDXComponents } from '@components/mdx';
import { AppStateProvider } from '@components/app-state';
import { MdxOverrides } from '@components/mdx/overrides';
import { ProgressBar } from '@components/progress-bar';
@ -17,11 +15,9 @@ export const AppWrapper: React.FC<any> = ({ children, isHome }) => {
<MdxOverrides />
<ColorModes />
<ProgressBar />
<MDXProvider components={MDXComponents}>
<AppStateProvider>
<BaseLayout isHome={isHome}>{children}</BaseLayout>
</AppStateProvider>
</MDXProvider>
<AppStateProvider>
<BaseLayout isHome={isHome}>{children}</BaseLayout>
</AppStateProvider>
</>
);
};

5
src/components/mdx/md-contents.tsx

@ -9,7 +9,8 @@ import dynamic from 'next/dynamic';
import { getHeadingStyles } from '@components/mdx/typography';
import { border } from '@common/utils';
import { getCapsizeStyles } from '@components/mdx/typography';
import { MDXProvider } from '@mdx-js/react';
import { MDXComponents } from '@components/mdx';
export const styleOverwrites = {
'& > section': {
'&:nth-child(2)': {
@ -256,7 +257,7 @@ export const MDContents: React.FC<any> = ({ pageTop: PageTop = null, headings, c
pr={!isHome && ['0', '0', '0', 'extra-loose']}
>
{PageTop && <PageTop />}
{children}
<MDXProvider components={MDXComponents}>{children}</MDXProvider>
</ContentWrapper>
{!isHome ? (
<Box

Loading…
Cancel
Save