mirror of
https://github.com/mastermindzh/rickvanlieshout.com
synced 2025-03-15 11:58:57 +01:00
38 lines
758 B
JavaScript
38 lines
758 B
JavaScript
|
import React from 'react';
|
||
|
import { graphql, StaticQuery } from 'gatsby';
|
||
|
import ReactDisqusComments from 'react-disqus-comments';
|
||
|
|
||
|
export const PureComments = ({ data, postTitle, postSlug }) => {
|
||
|
const {
|
||
|
siteUrl,
|
||
|
disqusShortname
|
||
|
} = data.site.siteMetadata;
|
||
|
|
||
|
return (
|
||
|
<ReactDisqusComments
|
||
|
shortname={disqusShortname}
|
||
|
identifier={postTitle}
|
||
|
title={postTitle}
|
||
|
url={siteUrl + postSlug}
|
||
|
/>
|
||
|
);
|
||
|
};
|
||
|
|
||
|
export const Comments = (props) => (
|
||
|
<StaticQuery
|
||
|
query={graphql`
|
||
|
query CommentsQuery {
|
||
|
site {
|
||
|
siteMetadata {
|
||
|
disqusShortname
|
||
|
url
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
`}
|
||
|
render={(data) => <PureComments {...props} data={data}/>}
|
||
|
/>
|
||
|
);
|
||
|
|
||
|
export default Comments;
|