From ba0a06136e8d9869ae9abd41d786600991459eef Mon Sep 17 00:00:00 2001
From: pfqgauxfb <3521106529@qq.com>
Date: Mon, 2 Jun 2025 22:48:27 +0800
Subject: [PATCH] feng
---
src/components/Comments/index.js | 87 ---------------
src/components/Comments/styles.module.css | 123 ----------------------
src/components/Rating/index.js | 1 -
src/components/Rating/styles.module.css | 1 -
src/theme/DocItem/index.js | 37 -------
src/theme/DocItem/styles.module.css | 1 -
6 files changed, 250 deletions(-)
delete mode 100644 src/components/Comments/index.js
delete mode 100644 src/components/Comments/styles.module.css
delete mode 100644 src/components/Rating/index.js
delete mode 100644 src/components/Rating/styles.module.css
delete mode 100644 src/theme/DocItem/index.js
delete mode 100644 src/theme/DocItem/styles.module.css
diff --git a/src/components/Comments/index.js b/src/components/Comments/index.js
deleted file mode 100644
index 5e82265..0000000
--- a/src/components/Comments/index.js
+++ /dev/null
@@ -1,87 +0,0 @@
-import React, { useState } from 'react';
-import { useDoc } from '@docusaurus/theme-common/internal';
-import styles from './styles.module.css';
-
-const Comments = () => {
- const doc = useDoc();
- const [rating, setRating] = useState(0);
- const [comment, setComment] = useState('');
- const [comments, setComments] = useState([]);
-
- const handleSubmit = (e) => {
- e.preventDefault();
- if (comment.trim()) {
- setComments([
- ...comments,
- {
- rating,
- text: comment,
- date: new Date().toLocaleString(),
- docId: doc.id,
- },
- ]);
- setComment('');
- setRating(0);
- }
- };
-
- return (
-
-
文档评分与评论
-
-
-
- {[1, 2, 3, 4, 5].map((star) => (
- setRating(star)}
- >
- ★
-
- ))}
-
-
- {rating ? `您给了 ${rating} 星评价` : '请为本文档评分'}
-
-
-
-
-
-
- {comments
- .filter((item) => item.docId === doc.id)
- .map((item, index) => (
-
-
-
- {[1, 2, 3, 4, 5].map((star) => (
-
- ★
-
- ))}
-
-
{item.date}
-
-
{item.text}
-
- ))}
-
-
- );
-};
-
-export default Comments;
\ No newline at end of file
diff --git a/src/components/Comments/styles.module.css b/src/components/Comments/styles.module.css
deleted file mode 100644
index fa3122a..0000000
--- a/src/components/Comments/styles.module.css
+++ /dev/null
@@ -1,123 +0,0 @@
-.commentsContainer {
- margin-top: 2rem;
- padding: 1.5rem;
- background: var(--ifm-background-color);
- border-radius: 8px;
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
-}
-
-.commentsContainer h3 {
- margin-bottom: 1.5rem;
- color: var(--ifm-color-emphasis-800);
- font-size: 1.2rem;
-}
-
-.ratingSection {
- margin-bottom: 1.5rem;
- text-align: center;
-}
-
-.stars {
- display: flex;
- justify-content: center;
- gap: 0.5rem;
- margin-bottom: 0.5rem;
-}
-
-.star {
- font-size: 1.5rem;
- color: #ddd;
- cursor: pointer;
- transition: color 0.2s;
-}
-
-.star:hover,
-.star.active {
- color: #ffd700;
-}
-
-.ratingText {
- color: var(--ifm-color-emphasis-600);
- font-size: 0.9rem;
-}
-
-.commentForm {
- margin-bottom: 2rem;
-}
-
-.commentInput {
- width: 100%;
- min-height: 100px;
- padding: 0.8rem;
- margin-bottom: 1rem;
- border: 1px solid var(--ifm-color-emphasis-300);
- border-radius: 4px;
- resize: vertical;
- font-family: inherit;
- font-size: 0.9rem;
-}
-
-.commentInput:focus {
- outline: none;
- border-color: var(--ifm-color-primary);
-}
-
-.submitButton {
- padding: 0.5rem 1.5rem;
- background: var(--ifm-color-primary);
- color: white;
- border: none;
- border-radius: 4px;
- cursor: pointer;
- font-size: 0.9rem;
- transition: background-color 0.2s;
-}
-
-.submitButton:hover {
- background: var(--ifm-color-primary-darker);
-}
-
-.commentsList {
- margin-top: 2rem;
-}
-
-.commentItem {
- padding: 1rem;
- margin-bottom: 1rem;
- background: var(--ifm-background-color);
- border: 1px solid var(--ifm-color-emphasis-200);
- border-radius: 4px;
-}
-
-.commentHeader {
- display: flex;
- justify-content: space-between;
- align-items: center;
- margin-bottom: 0.5rem;
-}
-
-.commentDate {
- color: var(--ifm-color-emphasis-600);
- font-size: 0.8rem;
-}
-
-.commentText {
- margin: 0;
- color: var(--ifm-color-emphasis-800);
- font-size: 0.9rem;
- line-height: 1.5;
-}
-
-/* 暗色模式适配 */
-[data-theme='dark'] .commentsContainer {
- background: var(--ifm-background-color);
-}
-
-[data-theme='dark'] .commentItem {
- background: var(--ifm-background-color);
- border-color: var(--ifm-color-emphasis-700);
-}
-
-[data-theme='dark'] .commentText {
- color: var(--ifm-color-emphasis-100);
-}
\ No newline at end of file
diff --git a/src/components/Rating/index.js b/src/components/Rating/index.js
deleted file mode 100644
index 0519ecb..0000000
--- a/src/components/Rating/index.js
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/src/components/Rating/styles.module.css b/src/components/Rating/styles.module.css
deleted file mode 100644
index 0519ecb..0000000
--- a/src/components/Rating/styles.module.css
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/src/theme/DocItem/index.js b/src/theme/DocItem/index.js
deleted file mode 100644
index b866867..0000000
--- a/src/theme/DocItem/index.js
+++ /dev/null
@@ -1,37 +0,0 @@
-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 (
-
-
-
-
-
-
-
- {doc.content}
-
-
-
-
-
-
-
-
-
- );
-}
\ No newline at end of file
diff --git a/src/theme/DocItem/styles.module.css b/src/theme/DocItem/styles.module.css
deleted file mode 100644
index 0519ecb..0000000
--- a/src/theme/DocItem/styles.module.css
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file