feat: 帖子收藏与用户关注
- 新增收藏功能:favorite 服务与 handler、FavoriteButton 组件 - 新增关注功能:follow 服务与 handler、FollowButton 组件 - 用户主页适配关注/粉丝与收藏展示 - flash 消息工具、广告与侧边栏组件微调
This commit is contained in:
@@ -78,6 +78,9 @@ export interface SidebarBlockProps {
|
||||
authorProfile?: UserProfile;
|
||||
authorPosts?: PostListItem[];
|
||||
toc?: TocItem[];
|
||||
// 板块 id → 名称/配色下标:板块管理员徽章展示「{板块名}板块管理员」并对齐板块色
|
||||
boardNames?: Record<number, string>;
|
||||
boardColors?: Record<number, number>;
|
||||
}
|
||||
|
||||
// 内置块注册表:key → 组件。数据未就绪或未知 key 返回 null(渲染层静默跳过)。
|
||||
@@ -143,7 +146,12 @@ export function renderSidebarBlock(key: string, p: SidebarBlockProps) {
|
||||
return p.postBoard ? <PostBoardCard board={p.postBoard} /> : null;
|
||||
case "post_author":
|
||||
return p.authorProfile ? (
|
||||
<PostAuthorCard profile={p.authorProfile} allowComments={p.allowComments} />
|
||||
<PostAuthorCard
|
||||
profile={p.authorProfile}
|
||||
allowComments={p.allowComments}
|
||||
boardNames={p.boardNames}
|
||||
boardColors={p.boardColors}
|
||||
/>
|
||||
) : null;
|
||||
case "post_author_posts":
|
||||
return p.authorPosts ? <PostAuthorPosts posts={p.authorPosts} /> : null;
|
||||
|
||||
Reference in New Issue
Block a user