Skip to content

Commit

Permalink
fix mdx
Browse files Browse the repository at this point in the history
  • Loading branch information
adamsoffer committed May 2, 2021
1 parent 1c273ed commit 632a942
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
10 changes: 0 additions & 10 deletions hooks/useMdx.tsx

This file was deleted.

8 changes: 6 additions & 2 deletions pages/blog/[slug].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ import { useRouter } from "next/router";
import { NextSeo } from "next-seo";
import seo from "../../next-seo.config";
import { getContent, getFile, getFileData, getSlugs } from "../../lib/mdx";
import { useMDX } from "../../hooks/useMdx";
import hydrate from "next-mdx-remote/hydrate";
import MDXComponents from "../../components/MDXComponents";

const StyledButton = styled(Button, {
border: "1px solid",
Expand All @@ -30,12 +31,15 @@ const StyledButton = styled(Button, {
const Post = ({ slug, content, data, projects }) => {
const router = useRouter();
const { isFallback } = router;
const mdx = useMDX(content);

if (isFallback) {
return <Layout data={{ projects }}>Loading</Layout>;
}

const mdx = hydrate(content, {
components: MDXComponents,
});

const nextSeo = {
...seo,
title: `The Web3 Index - ${data.seoTitle}`,
Expand Down

1 comment on commit 632a942

@vercel
Copy link

@vercel vercel bot commented on 632a942 May 2, 2021

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.