From 17842893306410f878eed66af5e807870e61cc49 Mon Sep 17 00:00:00 2001
From: Armand Philippot <git@armandphilippot.com>
Date: Mon, 21 Feb 2022 19:34:01 +0100
Subject: refactor: replace script tags with next/script (#10)

* refactor: replace script tags with next/script

Since next.js v12.1.0 some warnings was displayed because I was using
some script tags.

* build(deps): bump next-themes to v0.1.1
---
 src/components/Comment/Comment.tsx | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

(limited to 'src/components/Comment/Comment.tsx')

diff --git a/src/components/Comment/Comment.tsx b/src/components/Comment/Comment.tsx
index a263771..7215afe 100644
--- a/src/components/Comment/Comment.tsx
+++ b/src/components/Comment/Comment.tsx
@@ -3,10 +3,10 @@ import CommentForm from '@components/CommentForm/CommentForm';
 import { Comment as CommentData } from '@ts/types/comments';
 import { settings } from '@utils/config';
 import { getFormattedDate } from '@utils/helpers/format';
-import Head from 'next/head';
 import Image from 'next/image';
 import Link from 'next/link';
 import { useRouter } from 'next/router';
+import Script from 'next/script';
 import { useEffect, useRef, useState } from 'react';
 import { useIntl } from 'react-intl';
 import { Comment as CommentSchema, WithContext } from 'schema-dts';
@@ -175,12 +175,11 @@ const Comment = ({
 
   return (
     <>
-      <Head>
-        <script
-          type="application/ld+json"
-          dangerouslySetInnerHTML={{ __html: JSON.stringify(schemaJsonLd) }}
-        ></script>
-      </Head>
+      <Script
+        id="schema-comments"
+        type="application/ld+json"
+        dangerouslySetInnerHTML={{ __html: JSON.stringify(schemaJsonLd) }}
+      />
       <li className={styles.item}>
         {comment.approved ? getApprovedComment() : getCommentStatus()}
       </li>
-- 
cgit v1.2.3

