From a6056b2c613629ceac70fc6cd9caaf655fdd02a1 Mon Sep 17 00:00:00 2001 From: Laurie Barth Date: Fri, 8 May 2020 11:21:16 -0400 Subject: [PATCH] Errant file deletion broke prism in theme --- .../src/gatsby-plugin-theme-ui/components.js | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 packages/gatsby-theme-blog/src/gatsby-plugin-theme-ui/components.js diff --git a/packages/gatsby-theme-blog/src/gatsby-plugin-theme-ui/components.js b/packages/gatsby-theme-blog/src/gatsby-plugin-theme-ui/components.js new file mode 100644 index 0000000000000..4f2d235bd25d9 --- /dev/null +++ b/packages/gatsby-theme-blog/src/gatsby-plugin-theme-ui/components.js @@ -0,0 +1,28 @@ +/** @jsx jsx */ + +import { jsx } from "theme-ui" +import { preToCodeBlock } from "mdx-utils" +import PrismCodeBlock from "@theme-ui/prism" + +import headings from "../components/headings" + +const CodeBlock = preProps => { + const props = preToCodeBlock(preProps) + + if (props) { + const { codeString, ...restProps } = props + + return ( +
+ {codeString} +
+ ) + } else { + return
+  }
+}
+
+export default {
+  pre: CodeBlock,
+  ...headings,
+}