mirror of
https://github.com/KazooTTT/kazoottt-blog.git
synced 2025-06-22 18:21:33 +08:00
fix: client load
This commit is contained in:
@ -1,18 +1,13 @@
|
|||||||
|
'use client'
|
||||||
|
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import Giscus from '@giscus/react'
|
import Giscus from '@giscus/react'
|
||||||
|
|
||||||
const id = 'inject-comments'
|
const id = 'inject-comments'
|
||||||
|
|
||||||
const GiscusComment = () => {
|
const GiscusComment = () => {
|
||||||
const [mounted, setMounted] = React.useState(false)
|
|
||||||
|
|
||||||
React.useEffect(() => {
|
|
||||||
setMounted(true)
|
|
||||||
}, [])
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div id={id} className='mt-8 w-full'>
|
<div id={id} className='mt-8 w-full'>
|
||||||
{mounted ? (
|
|
||||||
<Giscus
|
<Giscus
|
||||||
id={id}
|
id={id}
|
||||||
repo='KazooTTT/kazoottt-blog'
|
repo='KazooTTT/kazoottt-blog'
|
||||||
@ -28,7 +23,6 @@ const GiscusComment = () => {
|
|||||||
lang='zh-CN'
|
lang='zh-CN'
|
||||||
loading='lazy'
|
loading='lazy'
|
||||||
/>
|
/>
|
||||||
) : null}
|
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -23,5 +23,5 @@ const { Content } = await entry.render()
|
|||||||
|
|
||||||
<PostLayout post={entry}>
|
<PostLayout post={entry}>
|
||||||
<Content />
|
<Content />
|
||||||
<GiscusComment client:only='react' />
|
<GiscusComment client:only='react' client:load />
|
||||||
</PostLayout>
|
</PostLayout>
|
||||||
|
@ -211,5 +211,5 @@ const projects = [...directProjects, ...mdProjects].slice(0, MAX_PROJECTS)
|
|||||||
</div>
|
</div>
|
||||||
</Section>
|
</Section>
|
||||||
</div>
|
</div>
|
||||||
<GiscusComment client:only='react' />
|
<GiscusComment client:only='react' client:load />
|
||||||
</PageLayout>
|
</PageLayout>
|
||||||
|
@ -14,7 +14,7 @@ const SOFTWARE_TOOLS = {
|
|||||||
{
|
{
|
||||||
name: 'WindSurf',
|
name: 'WindSurf',
|
||||||
description: 'AI-Powered IDE',
|
description: 'AI-Powered IDE',
|
||||||
href: 'https://windsurf.app/',
|
href: 'https://windsurf.app/'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Cursor',
|
name: 'Cursor',
|
||||||
@ -403,16 +403,10 @@ const DEVICES = {
|
|||||||
<p>Tools, software, and devices I use daily</p>
|
<p>Tools, software, and devices I use daily</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<CategorySection
|
<CategorySection title='Software Tools' categories={Object.values(SOFTWARE_TOOLS)} />
|
||||||
title="Software Tools"
|
|
||||||
categories={Object.values(SOFTWARE_TOOLS)}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<CategorySection
|
<CategorySection title='Hardware Devices' categories={Object.values(DEVICES)} />
|
||||||
title="Hardware Devices"
|
|
||||||
categories={Object.values(DEVICES)}
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<GiscusComment client:only='react' />
|
<GiscusComment client:only='react' client:load />
|
||||||
</PageLayout>
|
</PageLayout>
|
||||||
|
Reference in New Issue
Block a user