Skip to content

Commit

Permalink
fix(blog): Fix Disqus comments
Browse files Browse the repository at this point in the history
  • Loading branch information
kalecream committed Feb 6, 2024
1 parent 33c37c7 commit b7c206c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 26 deletions.
22 changes: 0 additions & 22 deletions frontend/src/components/blog/DisqusComments.tsx

This file was deleted.

17 changes: 13 additions & 4 deletions frontend/src/pages/posts/[slug].tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Page from '@containers/layout/BlogPage';
import Head from 'next/head';
import { Key, useEffect, useState } from 'react';
import { Key, ReactFragment, useEffect, useState } from 'react';
import { format, parseISO } from 'date-fns';
import fs from 'fs';
import matter from 'gray-matter';
Expand All @@ -18,8 +18,9 @@ import rehypeSlug from 'rehype-slug';
import { useHeadsObserver } from '@hooks/useObserver';
import getReadTime from '@utils/read-time';
import { ReactNode } from '@mdx-js/react/lib';
import { DisqusComments, CustomComponents } from '@components/blog';
import { DiscussionEmbed } from 'disqus-react';
import article from '@components/blog/articles.module.scss';
import { CustomComponents } from '@components/blog/CustomElements';

type PostPageProps = {
source: MDXRemoteSerializeResult;
Expand All @@ -28,7 +29,7 @@ type PostPageProps = {

type HeadingProps = {
id: Key | any;
text: ReactNode;
text: ReactFragment | ReactNode;
level: string;
};

Expand Down Expand Up @@ -117,7 +118,15 @@ const PostPage = ({ source, frontMatter }: PostPageProps): JSX.Element => {
<MDXRemote {...source} components={CustomComponents} />
</div>
<div className={article.comments}>
<DisqusComments postId={frontMatter.id} title={frontMatter.title} slug={frontMatter.slug} />
<DiscussionEmbed
shortname="sabrinamedwinter"
config={{
url: 'https://www.sabrinamedwinter.com/posts/' + frontMatter.slug,
identifier: frontMatter.id,
title: frontMatter.title,
language: 'en_EN',
}}
/>
</div>
</article>
</Page>
Expand Down

0 comments on commit b7c206c

Please sign in to comment.