Skip to content

Commit

Permalink
所有界面增加评论
Browse files Browse the repository at this point in the history
  • Loading branch information
buyfakett committed Feb 21, 2025
1 parent 65ad9a0 commit e227af3
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 16 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2025-02-21 所有界面加上评论

2025-02-21 项目升级`Tailwind CSS`到v4

2025-02-18 项目迁移至`Rsbuild`

2025-01-25 增加更多项目界面
Expand Down
3 changes: 3 additions & 0 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { Helmet } from 'react-helmet';
import ChangeLog from '@/util/ChangeLog';
import Coffee from '@/view/Coffee';
import Projects from '@/view/Projects/index';
import Comment from "@/util/Comment";

const App = () => {
// semi-design的主题默认为暗色
Expand Down Expand Up @@ -90,6 +91,8 @@ const App = () => {
<Route path="*" element={<NotFound />} />
</Routes>

<Comment />

<Footer buildInfo={buildInfo} />

{/*返回顶部*/}
Expand Down
26 changes: 26 additions & 0 deletions src/util/Comment.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import React from 'react';
import Giscus from '@giscus/react';

const Comment = () => {
return (
<div className="w-[60%] mx-auto mt-10">
<Giscus
id="comments"
repo="buyfakett/blog-comments"
repoId="R_kgDONjzEIQ"
category="Q&A"
categoryId="DIC_kwDONjzEIc4Clmn0"
mapping="pathname"
term="Welcome to @giscus/react component!"
reactionsEnabled="1"
emitMetadata="0"
inputPosition="bottom"
theme="noborder_dark"
lang="zh-CN"
loading="lazy"
/>
</div>
);
};

export default Comment;
16 changes: 0 additions & 16 deletions src/view/Coffee/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { imgUrl, pageVariants } from '@/config';
import { Button, Image } from '@douyinfe/semi-ui';
import { IoIosArrowBack } from 'react-icons/io';
import { useNavigate } from 'react-router';
import Giscus from '@giscus/react';

const Coffee = () => {
const navigate = useNavigate();
Expand Down Expand Up @@ -41,21 +40,6 @@ const Coffee = () => {
Communicate with me
</h2>
</div>
<Giscus
id="comments"
repo="buyfakett/blog-comments"
repoId="R_kgDONjzEIQ"
category="Q&A"
categoryId="DIC_kwDONjzEIc4Clmn0"
mapping="pathname"
term="Welcome to @giscus/react component!"
reactionsEnabled="1"
emitMetadata="0"
inputPosition="bottom"
theme="noborder_dark"
lang="zh-CN"
loading="lazy"
/>
</div>
</motion.div>
);
Expand Down

0 comments on commit e227af3

Please sign in to comment.