feat: 外观支持自定义 CSS/JS,并升级发帖工作台与积分存量看板
后台可注入全站 CSS/JS(SSR 生效,CSS 可热换);发帖/编辑改为锁一屏工作室;经济看板增加存量健康度;主题令牌与弹层误关一并收紧。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
22
frontend/app/post/[id]/edit/layout.tsx
Normal file
22
frontend/app/post/[id]/edit/layout.tsx
Normal file
@@ -0,0 +1,22 @@
|
||||
import type { Metadata } from "next";
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "编辑帖子",
|
||||
robots: { index: false, follow: false },
|
||||
};
|
||||
|
||||
/** 编辑帖与发帖共用工作台视口(锁一屏、隐藏页脚) */
|
||||
export default function EditPostLayout({
|
||||
children,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
return (
|
||||
<div
|
||||
data-compose-viewport
|
||||
className="flex flex-col flex-1 min-h-0 w-full"
|
||||
>
|
||||
{children}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -1,7 +1,5 @@
|
||||
import { cookies } from "next/headers";
|
||||
import { notFound, redirect } from "next/navigation";
|
||||
import Link from "next/link";
|
||||
import { ChevronRight } from "lucide-react";
|
||||
import { authCookieHeader } from "@/lib/cookies";
|
||||
import { getMeCached } from "@/lib/serverData";
|
||||
import { fetchPostDetail } from "@/lib/api";
|
||||
@@ -35,25 +33,7 @@ export default async function EditPostPage({ params }: PageProps) {
|
||||
}
|
||||
|
||||
return (
|
||||
<div
|
||||
data-compose-viewport
|
||||
className="j13-compose-page w-full"
|
||||
>
|
||||
<nav className="meta -mt-4 sm:-mt-6 mb-1.5 flex items-center gap-1 flex-wrap text-[12.5px] leading-none shrink-0">
|
||||
<Link href="/" className="hover:text-[var(--accent)] transition-colors">
|
||||
首页
|
||||
</Link>
|
||||
<ChevronRight size={13} />
|
||||
<Link
|
||||
href={`/post/${post.id}`}
|
||||
className="hover:text-[var(--accent)] transition-colors truncate max-w-[12rem]"
|
||||
>
|
||||
帖子详情
|
||||
</Link>
|
||||
<ChevronRight size={13} />
|
||||
<span style={{ color: "var(--ink-2)" }}>编辑</span>
|
||||
</nav>
|
||||
|
||||
<div className="j13-compose-page w-full">
|
||||
<EditPostClient
|
||||
postId={post.id}
|
||||
initialTitle={post.title}
|
||||
|
||||
@@ -236,7 +236,7 @@ function AuthorPosts({ posts }: { posts: PostListItem[] }) {
|
||||
<Link
|
||||
href={`/post/${p.id}`}
|
||||
data-tip={p.title}
|
||||
className="block rounded-[10px] px-2 py-2 transition-colors hover:bg-[var(--accent-soft)] focus-visible:bg-[var(--accent-soft)]"
|
||||
className="block rounded-[10px] px-2 py-2 transition-colors hover:bg-[var(--panel-2)] focus-visible:bg-[var(--panel-2)]"
|
||||
>
|
||||
<span
|
||||
className="block text-[13px] leading-snug line-clamp-2"
|
||||
|
||||
Reference in New Issue
Block a user