From 262dfade4e9c0c345873b23fa860e750aa998ff2 Mon Sep 17 00:00:00 2001 From: ditiqi Date: Sun, 26 Jan 2025 18:32:47 +0800 Subject: [PATCH] add 0125 --- .../src/components/common/uploader/TusUploader.tsx | 8 ++++---- apps/web/src/components/models/post/LetterCard.tsx | 2 +- .../models/post/detail/PostCommentCard.tsx | 4 ++-- .../models/post/detail/PostHeader/PostLikeButton.tsx | 12 ++++++------ .../models/post/detail/PostHeader/StatsSection.tsx | 2 +- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/apps/web/src/components/common/uploader/TusUploader.tsx b/apps/web/src/components/common/uploader/TusUploader.tsx index 12f8f9d..c41ba95 100644 --- a/apps/web/src/components/common/uploader/TusUploader.tsx +++ b/apps/web/src/components/common/uploader/TusUploader.tsx @@ -4,9 +4,10 @@ import { CheckCircleOutlined, DeleteOutlined, } from "@ant-design/icons"; -import { Upload, message, Progress, Button } from "antd"; +import { Upload, Progress, Button } from "antd"; import type { UploadFile } from "antd"; import { useTusUpload } from "@web/src/hooks/useTusUpload"; +import toast from "react-hot-toast"; export interface TusUploaderProps { value?: string[]; @@ -52,7 +53,7 @@ export const TusUploader = ({ value = [], onChange }: TusUploaderProps) => { console.log("文件", files); if (!files.every((f) => f instanceof File)) { - message.error("无效的文件格式"); + toast.error("无效的文件格式"); return false; } @@ -111,10 +112,9 @@ export const TusUploader = ({ value = [], onChange }: TusUploaderProps) => { ); setUploadResults(newValue); onChange?.(newValue); - message.success(`${files.length} 个文件上传成功`); } catch (error) { console.error("上传错误详情:", error); - message.error( + toast.error( `上传失败: ${error instanceof Error ? error.message : "未知错误"}` ); setUploadingFiles((prev) => diff --git a/apps/web/src/components/models/post/LetterCard.tsx b/apps/web/src/components/models/post/LetterCard.tsx index 27ca0b2..61b8393 100644 --- a/apps/web/src/components/models/post/LetterCard.tsx +++ b/apps/web/src/components/models/post/LetterCard.tsx @@ -117,8 +117,8 @@ export function LetterCard({ letter }: LetterCardProps) { 浏览量 {letter.views} - + diff --git a/apps/web/src/components/models/post/detail/PostCommentCard.tsx b/apps/web/src/components/models/post/detail/PostCommentCard.tsx index 7a0cfd3..7cef4fd 100644 --- a/apps/web/src/components/models/post/detail/PostCommentCard.tsx +++ b/apps/web/src/components/models/post/detail/PostCommentCard.tsx @@ -65,10 +65,10 @@ export default function PostCommentCard({ )} - + {`#${index + 1}`} diff --git a/apps/web/src/components/models/post/detail/PostHeader/PostLikeButton.tsx b/apps/web/src/components/models/post/detail/PostHeader/PostLikeButton.tsx index 93fdea6..a1d723b 100644 --- a/apps/web/src/components/models/post/detail/PostHeader/PostLikeButton.tsx +++ b/apps/web/src/components/models/post/detail/PostHeader/PostLikeButton.tsx @@ -35,16 +35,16 @@ export default function PostLikeButton({ post }: { post: PostDto }) { title={post?.liked ? "取消点赞" : "点赞"} type={post?.liked ? "primary" : "default"} shape="round" - + style={{ + boxShadow: "none", // 去除阴影 + }} icon={post?.liked ? : } onClick={(e) => { - e.stopPropagation() - likeThisPost() - }} - > + e.stopPropagation(); + likeThisPost(); + }}> 有帮助 {post?.likes} - ); } diff --git a/apps/web/src/components/models/post/detail/PostHeader/StatsSection.tsx b/apps/web/src/components/models/post/detail/PostHeader/StatsSection.tsx index 005da03..7e49dde 100644 --- a/apps/web/src/components/models/post/detail/PostHeader/StatsSection.tsx +++ b/apps/web/src/components/models/post/detail/PostHeader/StatsSection.tsx @@ -26,8 +26,8 @@ export function StatsSection() { - +