parent
6d2cd1c295
commit
a134f85b10
@ -0,0 +1,39 @@
|
||||
import React from 'react';
|
||||
import Giscus from '@giscus/react';
|
||||
import Rating from '../Rating';
|
||||
import styles from './styles.module.css';
|
||||
|
||||
const Comments = () => {
|
||||
const handleRating = (rating) => {
|
||||
// 这里可以添加评分提交逻辑
|
||||
console.log('Rating submitted:', rating);
|
||||
};
|
||||
|
||||
return (
|
||||
<div className={styles.commentsContainer}>
|
||||
<div className={styles.ratingSection}>
|
||||
<h3>文档评分</h3>
|
||||
<Rating onRatingChange={handleRating} />
|
||||
</div>
|
||||
|
||||
<div className={styles.commentsSection}>
|
||||
<h3>评论区</h3>
|
||||
<Giscus
|
||||
id="comments"
|
||||
repo="luffyZh/gitlink_help_center"
|
||||
repoId="R_kgDOJQYwXg"
|
||||
category="Comments"
|
||||
categoryId="DIC_kwDOJQYwXs4CQYwX"
|
||||
mapping="pathname"
|
||||
reactionsEnabled="1"
|
||||
emitMetadata="0"
|
||||
inputPosition="bottom"
|
||||
lang="zh-CN"
|
||||
loading="lazy"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default Comments;
|
@ -0,0 +1 @@
|
||||
|
@ -0,0 +1 @@
|
||||
|
@ -0,0 +1 @@
|
||||
|
@ -0,0 +1,37 @@
|
||||
import React from 'react';
|
||||
import {useDoc} from '@docusaurus/theme-common/internal';
|
||||
import DocItemContent from '@theme-original/DocItem/Content';
|
||||
import DocItemFooter from '@theme-original/DocItem/Footer';
|
||||
import DocItemPaginator from '@theme-original/DocItem/Paginator';
|
||||
import DocItemTOCMobile from '@theme-original/DocItem/TOC/Mobile';
|
||||
import DocItemTOCDesktop from '@theme-original/DocItem/TOC/Desktop';
|
||||
import DocVersionBadge from '@theme-original/DocVersionBadge';
|
||||
import DocVersionBanner from '@theme-original/DocVersionBanner';
|
||||
import DocItemLayout from '@theme-original/DocItem/Layout';
|
||||
import Comments from '@site/src/components/Comments';
|
||||
|
||||
export default function DocItem(props) {
|
||||
const doc = useDoc();
|
||||
return (
|
||||
<DocItemLayout {...props}>
|
||||
<DocVersionBanner />
|
||||
<div className="container margin-vert--lg">
|
||||
<div className="row">
|
||||
<main className="col col--8">
|
||||
<DocItemContent>
|
||||
<DocVersionBadge />
|
||||
{doc.content}
|
||||
</DocItemContent>
|
||||
<DocItemFooter />
|
||||
<Comments />
|
||||
</main>
|
||||
<aside className="col col--4">
|
||||
<DocItemTOCDesktop />
|
||||
<DocItemTOCMobile />
|
||||
</aside>
|
||||
</div>
|
||||
</div>
|
||||
<DocItemPaginator />
|
||||
</DocItemLayout>
|
||||
);
|
||||
}
|
@ -0,0 +1 @@
|
||||
|
Loading…
Reference in new issue