mirror of
https://github.com/KazooTTT/kazoottt-blog.git
synced 2025-06-23 10:41:31 +08:00
feat: add giscus
This commit is contained in:
36
src/components/GiscusComment.tsx
Normal file
36
src/components/GiscusComment.tsx
Normal file
@ -0,0 +1,36 @@
|
||||
import React from 'react'
|
||||
import Giscus from '@giscus/react'
|
||||
|
||||
const id = 'inject-comments'
|
||||
|
||||
const GiscusComment = () => {
|
||||
const [mounted, setMounted] = React.useState(false)
|
||||
|
||||
React.useEffect(() => {
|
||||
setMounted(true)
|
||||
}, [])
|
||||
|
||||
return (
|
||||
<div id={id} className='w-full'>
|
||||
{mounted ? (
|
||||
<Giscus
|
||||
id={id}
|
||||
repo='KazooTTT/kazoottt-blog'
|
||||
repoId='R_kgDOMa4jRQ'
|
||||
category='Announcements'
|
||||
categoryId='DIC_kwDOMa4jRc4CjRFe'
|
||||
mapping='pathname'
|
||||
strict='0'
|
||||
reactionsEnabled='1'
|
||||
emitMetadata='0'
|
||||
inputPosition='bottom'
|
||||
theme='preferred_color_scheme'
|
||||
lang='zh-CN'
|
||||
loading='lazy'
|
||||
/>
|
||||
) : null}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default GiscusComment
|
Reference in New Issue
Block a user