2018-11-09 20:08:48 +03:00
|
|
|
import React from 'react';
|
|
|
|
import ReactDisqusComments from 'react-disqus-comments';
|
2019-05-09 16:57:42 +03:00
|
|
|
import { useSiteMetadata } from '../../../hooks';
|
2018-11-09 20:08:48 +03:00
|
|
|
|
2019-05-09 16:57:42 +03:00
|
|
|
const Comments = ({ postTitle, postSlug }) => {
|
|
|
|
const { url, disqusShortname } = useSiteMetadata();
|
2018-11-09 20:08:48 +03:00
|
|
|
|
2019-01-24 20:44:13 +03:00
|
|
|
if (!disqusShortname) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2018-11-09 20:08:48 +03:00
|
|
|
return (
|
|
|
|
<ReactDisqusComments
|
|
|
|
shortname={disqusShortname}
|
|
|
|
identifier={postTitle}
|
|
|
|
title={postTitle}
|
2019-02-07 15:08:12 -05:00
|
|
|
url={url + postSlug}
|
2018-11-09 20:08:48 +03:00
|
|
|
/>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default Comments;
|