Skip to content

Commit 765d536

Browse files
committed
temp codeblock
1 parent b05b329 commit 765d536

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

src/components/Layout/MDXWrapper.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ import '../../styles/global.css';
55
import PageTitle from '../PageTitle';
66
import { MarkdownProvider } from '../Markdown';
77
import Article from '../Article';
8-
import Conditional from 'src/components/Layout/mdx/conditional';
8+
import Conditional from './mdx/Conditional';
9+
import CodeBlock from './mdx/CodeBlock';
910

1011
type PageContextType = {
1112
frontmatter: {
@@ -22,7 +23,7 @@ const MDXWrapper: React.FC<MDXWrapperProps> = ({ children, pageContext }) => {
2223

2324
return (
2425
<Article>
25-
<MarkdownProvider extraComponents={{ Conditional }}>
26+
<MarkdownProvider extraComponents={{ Conditional, CodeBlock }}>
2627
{title && <PageTitle>{title}</PageTitle>}
2728
{children}
2829
</MarkdownProvider>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import React, { ReactNode } from 'react';
2+
3+
interface CodeBlockProps {
4+
children: ReactNode;
5+
}
6+
7+
const CodeBlock: React.FC<CodeBlockProps> = ({ children }) => {
8+
return <div className="code-block">{children}</div>;
9+
};
10+
11+
export default CodeBlock;

0 commit comments

Comments
 (0)