mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-15 15:09:25 +00:00
添加页面可以隐藏评论的属性
This commit is contained in:
@@ -121,82 +121,84 @@ const Comment = ({ frontMatter, className }) => {
|
||||
return null
|
||||
}
|
||||
|
||||
return (
|
||||
<div
|
||||
key={frontMatter?.id}
|
||||
id='comment'
|
||||
ref={commentRef}
|
||||
className={`comment mt-5 text-gray-800 dark:text-gray-300 ${className || ''}`}>
|
||||
{/* 延迟加载评论区 */}
|
||||
{!shouldLoad && (
|
||||
<div className='text-center'>
|
||||
Loading...
|
||||
<i className='fas fa-spinner animate-spin text-3xl ' />
|
||||
</div>
|
||||
)}
|
||||
if (frontMatter?.comment != 'Hide') {
|
||||
return (
|
||||
<div
|
||||
key={frontMatter?.id}
|
||||
id='comment'
|
||||
ref={commentRef}
|
||||
className={`comment mt-5 text-gray-800 dark:text-gray-300 ${className || ''}`}>
|
||||
{/* 延迟加载评论区 */}
|
||||
{!shouldLoad && (
|
||||
<div className='text-center'>
|
||||
Loading...
|
||||
<i className='fas fa-spinner animate-spin text-3xl ' />
|
||||
</div>
|
||||
)}
|
||||
|
||||
{shouldLoad && (
|
||||
<Tabs>
|
||||
{COMMENT_ARTALK_SERVER && (
|
||||
<div key='Artalk'>
|
||||
<Artalk />
|
||||
</div>
|
||||
)}
|
||||
{shouldLoad && (
|
||||
<Tabs>
|
||||
{COMMENT_ARTALK_SERVER && (
|
||||
<div key='Artalk'>
|
||||
<Artalk />
|
||||
</div>
|
||||
)}
|
||||
|
||||
{COMMENT_TWIKOO_ENV_ID && (
|
||||
<div key='Twikoo'>
|
||||
<TwikooCompenent />
|
||||
</div>
|
||||
)}
|
||||
{COMMENT_TWIKOO_ENV_ID && (
|
||||
<div key='Twikoo'>
|
||||
<TwikooCompenent />
|
||||
</div>
|
||||
)}
|
||||
|
||||
{COMMENT_WALINE_SERVER_URL && (
|
||||
<div key='Waline'>
|
||||
<WalineComponent />
|
||||
</div>
|
||||
)}
|
||||
{COMMENT_WALINE_SERVER_URL && (
|
||||
<div key='Waline'>
|
||||
<WalineComponent />
|
||||
</div>
|
||||
)}
|
||||
|
||||
{COMMENT_VALINE_APP_ID && (
|
||||
<div key='Valine' name='reply'>
|
||||
<ValineComponent path={frontMatter.id} />
|
||||
</div>
|
||||
)}
|
||||
{COMMENT_VALINE_APP_ID && (
|
||||
<div key='Valine' name='reply'>
|
||||
<ValineComponent path={frontMatter.id} />
|
||||
</div>
|
||||
)}
|
||||
|
||||
{COMMENT_GISCUS_REPO && (
|
||||
<div key='Giscus'>
|
||||
<GiscusComponent className='px-2' />
|
||||
</div>
|
||||
)}
|
||||
{COMMENT_GISCUS_REPO && (
|
||||
<div key='Giscus'>
|
||||
<GiscusComponent className='px-2' />
|
||||
</div>
|
||||
)}
|
||||
|
||||
{COMMENT_CUSDIS_APP_ID && (
|
||||
<div key='Cusdis'>
|
||||
<CusdisComponent frontMatter={frontMatter} />
|
||||
</div>
|
||||
)}
|
||||
{COMMENT_CUSDIS_APP_ID && (
|
||||
<div key='Cusdis'>
|
||||
<CusdisComponent frontMatter={frontMatter} />
|
||||
</div>
|
||||
)}
|
||||
|
||||
{COMMENT_UTTERRANCES_REPO && (
|
||||
<div key='Utterance'>
|
||||
<UtterancesComponent
|
||||
issueTerm={frontMatter.id}
|
||||
className='px-2'
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
{COMMENT_UTTERRANCES_REPO && (
|
||||
<div key='Utterance'>
|
||||
<UtterancesComponent
|
||||
issueTerm={frontMatter.id}
|
||||
className='px-2'
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{COMMENT_GITALK_CLIENT_ID && (
|
||||
<div key='GitTalk'>
|
||||
<GitalkComponent frontMatter={frontMatter} />
|
||||
</div>
|
||||
)}
|
||||
{COMMENT_GITALK_CLIENT_ID && (
|
||||
<div key='GitTalk'>
|
||||
<GitalkComponent frontMatter={frontMatter} />
|
||||
</div>
|
||||
)}
|
||||
|
||||
{COMMENT_WEBMENTION_ENABLE && (
|
||||
<div key='WebMention'>
|
||||
<WebMentionComponent frontMatter={frontMatter} className='px-2' />
|
||||
</div>
|
||||
)}
|
||||
</Tabs>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
{COMMENT_WEBMENTION_ENABLE && (
|
||||
<div key='WebMention'>
|
||||
<WebMentionComponent frontMatter={frontMatter} className='px-2' />
|
||||
</div>
|
||||
)}
|
||||
</Tabs>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
export default Comment
|
||||
|
||||
@@ -94,6 +94,7 @@ export default async function getPageProperties(
|
||||
properties.type = properties.type?.[0] || ''
|
||||
properties.status = properties.status?.[0] || ''
|
||||
properties.category = properties.category?.[0] || ''
|
||||
properties.comment = properties.comment?.[0] || ''
|
||||
|
||||
// 映射值:用户个性化type和status字段的下拉框选项,在此映射回代码的英文标识
|
||||
mapProperties(properties)
|
||||
|
||||
Reference in New Issue
Block a user