Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

Update Layout.tsx

Jonathan Summers-Muir829b8c589263
diff --git a/apps/www/layouts/Layout.tsx b/apps/www/layouts/Layout.tsx
index b284e0ba113..17bcb87bfdf 100644
--- a/apps/www/layouts/Layout.tsx
+++ b/apps/www/layouts/Layout.tsx
@@ -6,53 +6,15 @@ import CodeBlock from '~/components/CodeBlock/CodeBlock'
import ImageGrid from '~/components/ImageGrid'
import DefaultLayout from '~/components/Layouts/Default'
import Quote from '~/components/Quote'
+import mdxComponents from '~/lib/mdx/mdxComponents'
const ignoreClass = 'ignore-on-export'
-function getComponents(type: any) {
- const components = {
- CodeBlock,
- Quote,
- Avatar,
- code: (props: any) => {
- if (props.className !== ignoreClass) {
- return <CodeBlock {...props} />
- } else {
- return <code {...props} />
- }
- },
- ImageGrid,
- img: (props: any) => {
- if (props.className !== ignoreClass) {
- return (
- <div
- className={[
- 'next-image--dynamic-fill',
- type === 'blog' && 'to-scale-400 from-scale-500 rounded-lg border bg-gradient-to-r',
- ].join(' ')}
- >
- <Image
- {...props}
- className={['next-image--dynamic-fill', type === 'blog' && 'rounded-md border'].join(
- ' '
- )}
- layout="fill"
- />
- </div>
- )
- }
- return <img {...props} />
- },
- }
-
- return components
-}
-
export default function ContentsLayout({ context }: any) {
return (
<DefaultLayout>
<NextSeo {...context.meta} />
- <MDXProvider components={getComponents(context.type)}>
+ <MDXProvider components={mdxComponents()}>
<div className="prose max-w-none">{context.children}</div>
</MDXProvider>
</DefaultLayout>