summaryrefslogtreecommitdiffstats
path: root/src/components/Comment/Comment.tsx
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2022-03-09 23:23:47 +0100
committerGitHub <noreply@github.com>2022-03-09 23:23:47 +0100
commit847b7303278c7894e5d6b055e0e654f6cf809330 (patch)
tree1145c488ee0580eeb0709863c98f6ef2f413f478 /src/components/Comment/Comment.tsx
parent5b6639a3cf9b6c63045cb82e6ef1a43b0742c367 (diff)
refactor: update graphql queries (#14)
* refactor: replace postBy query postBy is now deprecated in WPGraphQL v1.7 * refactor: update post comments query PostBy is deprecated and it is now possible to use the post ID to query comments. * refactor: update get topic by slug query topicBy is deprecated * refactor: update get thematic by slug query thematicBy is deprecated
Diffstat (limited to 'src/components/Comment/Comment.tsx')
-rw-r--r--src/components/Comment/Comment.tsx13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/components/Comment/Comment.tsx b/src/components/Comment/Comment.tsx
index 0371288..e20c5aa 100644
--- a/src/components/Comment/Comment.tsx
+++ b/src/components/Comment/Comment.tsx
@@ -67,7 +67,10 @@ const Comment = ({
const getApprovedComment = () => {
return (
<>
- <article className={styles.wrapper} id={`comment-${comment.commentId}`}>
+ <article
+ className={styles.wrapper}
+ id={`comment-${comment.databaseId}`}
+ >
<header className={styles.header}>
{comment.author.gravatarUrl && (
<div className={styles.avatar}>
@@ -89,7 +92,7 @@ const Comment = ({
</dt>
<dd>
<time dateTime={comment.date}>
- <Link href={`#comment-${comment.commentId}`}>
+ <Link href={`#comment-${comment.databaseId}`}>
<a>{getLocaleDate()}</a>
</Link>
</time>
@@ -118,7 +121,7 @@ const Comment = ({
{shouldOpenForm && (
<DynamicCommentForm
articleId={articleId}
- parentId={comment.commentId}
+ parentId={comment.databaseId}
/>
)}
{comment.replies.length > 0 && (
@@ -127,7 +130,7 @@ const Comment = ({
return (
<Comment
articleId={articleId}
- key={reply.commentId}
+ key={reply.databaseId}
comment={reply}
isNested={true}
/>
@@ -152,7 +155,7 @@ const Comment = ({
const schemaJsonLd: WithContext<CommentSchema> = {
'@context': 'https://schema.org',
- '@id': `${settings.url}/#comment-${comment.commentId}`,
+ '@id': `${settings.url}/#comment-${comment.databaseId}`,
'@type': 'Comment',
parentItem: isNested
? { '@id': `${settings.url}/#comment-${comment.parentDatabaseId}` }