Skip to content

Commit

Permalink
[site/components/MDXPage][xs]: pass Hero component to mdx
Browse files Browse the repository at this point in the history
  • Loading branch information
olayway committed Jun 22, 2023
1 parent 492c21c commit e111adf
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions site/components/MDXPage.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
import { MDXRemote } from 'next-mdx-remote';
import { NextSeo } from 'next-seo';
import layouts from 'layouts';
import DocsPagination from './DocsPagination';
import { NextSeo } from 'next-seo';
import { Hero } from "@portaljs/core";

export default function MDXPage({ source, frontMatter }) {
const Layout = ({ children }) => {
const layoutName = frontMatter?.layout || 'default';
const LayoutComponent = layouts[layoutName];
const Layout = ({ children }) => {
const layoutName = frontMatter?.layout || 'default';
const LayoutComponent = layouts[layoutName];

return <LayoutComponent {...frontMatter}>{children}</LayoutComponent>;
};
return <LayoutComponent {...frontMatter}>{children}</LayoutComponent>;
};


return (
<Layout>
<MDXRemote {...source} components={{ DocsPagination, NextSeo }} />
</Layout>
);
return (
<Layout>
<MDXRemote {...source} components={{ DocsPagination, NextSeo, Hero }} />
</Layout>
);
}

1 comment on commit e111adf

@vercel
Copy link

@vercel vercel bot commented on e111adf Jun 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.