From 1ee512940ec6dcd0a55de9f106f6406efc0f7b58 Mon Sep 17 00:00:00 2001 From: zetaloop Date: Sat, 25 Apr 2026 21:41:01 +0800 Subject: [PATCH] feat(ui): refine post interaction surfaces --- app/(main)/post/new/page.tsx | 17 +++++----- components/post-comments.tsx | 58 ++++++++++++++++++++++----------- components/post-like-button.tsx | 5 +-- 3 files changed, 51 insertions(+), 29 deletions(-) diff --git a/app/(main)/post/new/page.tsx b/app/(main)/post/new/page.tsx index 10cc394..a680dcf 100644 --- a/app/(main)/post/new/page.tsx +++ b/app/(main)/post/new/page.tsx @@ -126,9 +126,9 @@ export default function NewPostPage() { 返回社区 - - - 发布帖子 + + + 发布帖子
@@ -186,17 +186,18 @@ export default function NewPostPage() { {imageFiles.map((file) => (
{file.name} @@ -205,7 +206,7 @@ export default function NewPostPage() { {imageFiles.length < 9 && (
diff --git a/components/post-comments.tsx b/components/post-comments.tsx index b4aa5b8..8180ebb 100644 --- a/components/post-comments.tsx +++ b/components/post-comments.tsx @@ -5,10 +5,11 @@ import { toApiError } from "@/lib/errors" import { notifyInfo } from "@/lib/toast" import type { Comment } from "@/lib/types" import { useRequireAuth } from "@/lib/use-require-auth" -import { Heart } from "lucide-react" +import { AlertCircle, Heart, MessageCircle } from "lucide-react" import { useCallback, useEffect, useState } from "react" import { Avatar, AvatarFallback, AvatarImage } from "./ui/avatar" import { Button } from "./ui/button" +import { EmptyState } from "./ui/empty-state" import { Textarea } from "./ui/textarea" interface PostCommentsProps { @@ -65,12 +66,15 @@ export function PostComments({ postId }: PostCommentsProps) { return (
-

- 评论 ({loading && comments.length === 0 ? "..." : comments.length}) -

+
+

评论

+ + {loading && comments.length === 0 ? "加载中" : `${comments.length} 条`} + +
{ event.preventDefault() requireAuth(async () => { @@ -95,42 +99,58 @@ export function PostComments({ postId }: PostCommentsProps) { >