评论插件 Giscus

This commit is contained in:
tangly1024
2022-03-28 18:08:14 +08:00
parent 71c7e6738a
commit a0943e631a
4 changed files with 63 additions and 4 deletions

View File

@@ -18,14 +18,26 @@ const UtterancesComponent = dynamic(
},
{ ssr: false }
)
const GiscusComponent = dynamic(
() => {
return import('@/components/Giscus')
},
{ ssr: false }
)
const Comment = ({ frontMatter }) => {
const router = useRouter()
const { locale } = useGlobal()
const { locale, isDarkMode } = useGlobal()
return (
<div id='comment' className='comment mt-5 text-gray-800 dark:text-gray-300'>
<Tabs>
{BLOG.COMMENT_GISCUS_REPO && (
<div key="Giscus">
<GiscusComponent isDarkMode={isDarkMode} className="px-2" />
</div>
)}
{BLOG.COMMENT_GITALK_CLIENT_ID && (<div key='GitTalk'>
<GitalkComponent
options={{