feat(ui): refine post interaction surfaces

This commit is contained in:
zetaloop
2026-04-25 21:41:01 +08:00
parent 29db9e5c0c
commit 1ee512940e
3 changed files with 51 additions and 29 deletions
+9 -8
View File
@@ -126,9 +126,9 @@ export default function NewPostPage() {
</Link>
<Card className="hover:shadow-card-hover">
<CardHeader>
<CardTitle className="tracking-tighter leading-tight"></CardTitle>
<Card className="border-border/80 shadow-sm">
<CardHeader className="border-b border-border/60">
<CardTitle className="tracking-tight leading-tight"></CardTitle>
</CardHeader>
<CardContent>
<form onSubmit={handleSubmit(onSubmit)} className="space-y-6">
@@ -186,17 +186,18 @@ export default function NewPostPage() {
{imageFiles.map((file) => (
<div
key={`${file.name}-${file.lastModified}-${file.size}`}
className="h-20 w-20 rounded-lg bg-muted flex items-center justify-center relative"
className="relative flex h-20 w-20 items-center justify-center rounded-lg border border-border/60 bg-muted/30"
>
<span className="max-w-16 truncate text-xs text-muted-foreground">
{file.name}
</span>
<button
type="button"
aria-label={`移除图片 ${file.name}`}
onClick={() =>
setImageFiles((files) => files.filter((item) => item !== file))
}
className="absolute -top-1 -right-1 h-4 w-4 rounded-full bg-destructive text-destructive-foreground flex items-center justify-center"
className="absolute -right-1 -top-1 flex h-5 w-5 items-center justify-center rounded-full bg-destructive text-destructive-foreground shadow-sm"
>
<X className="h-3 w-3" />
</button>
@@ -205,7 +206,7 @@ export default function NewPostPage() {
{imageFiles.length < 9 && (
<Label
htmlFor="post-images"
className="h-20 w-20 cursor-pointer rounded-lg border-2 border-dashed border-muted-foreground/25 flex flex-col items-center justify-center gap-1 text-muted-foreground hover:border-muted-foreground/50 transition-colors"
className="flex h-20 w-20 cursor-pointer flex-col items-center justify-center gap-1 rounded-lg border-2 border-dashed border-border/60 bg-muted/20 text-muted-foreground transition-colors hover:border-primary/60 hover:bg-muted/30 hover:text-foreground"
>
<ImagePlus className="h-5 w-5" />
<span className="text-[10px]"></span>
@@ -229,7 +230,7 @@ export default function NewPostPage() {
<Badge
key={tag}
variant={selectedTags.includes(tag) ? "default" : "outline"}
className="cursor-pointer"
className="cursor-pointer border-border/60"
onClick={() => toggleTag(tag)}
>
{tag}
@@ -246,7 +247,7 @@ export default function NewPostPage() {
>
{isSubmitting ? "发布中..." : "发布"}
</Button>
<Button type="button" variant="outline" asChild>
<Button type="button" variant="outline" className="border-border/60" asChild>
<Link href="/community"></Link>
</Button>
</div>