feat(home): add homepage hero banner and migrate community stats
- 新增首页欢迎横幅组件,包含时段问候、用户问候语、发帖引导按钮和社区统计数据 - 从CommunityPanels中移除stats相关逻辑,将社区统计迁移到新的HomeHero组件中 - 优化全局样式,添加横幅相关的CSS动画和样式类
This commit is contained in:
@@ -14,6 +14,7 @@ import PostRow from "@/components/PostRow";
|
||||
import FeedTabs, { type FeedSort } from "@/components/home/FeedTabs";
|
||||
import { WorkspaceNav, WorkspaceNavMobile } from "@/components/home/WorkspaceNav";
|
||||
import { CommunityPanels, CommunityPanelsMobile } from "@/components/home/CommunityPanels";
|
||||
import HomeHero from "@/components/home/HomeHero";
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "姜十三论坛 · 技术讨论社区",
|
||||
@@ -150,6 +151,8 @@ export default async function HomePage({ searchParams }: HomePageProps) {
|
||||
|
||||
return (
|
||||
<div>
|
||||
<HomeHero user={user} stats={overview?.stats ?? null} />
|
||||
|
||||
<WorkspaceNavMobile boards={boards} user={user} />
|
||||
|
||||
<div className="flex items-start gap-6 xl:gap-7 mt-5 lg:mt-0">
|
||||
@@ -201,22 +204,14 @@ export default async function HomePage({ searchParams }: HomePageProps) {
|
||||
|
||||
{/* 右栏:社区面板 */}
|
||||
{overview && (
|
||||
<CommunityPanels
|
||||
stats={overview.stats}
|
||||
hot={overview.hot}
|
||||
activeUsers={overview.active_users}
|
||||
/>
|
||||
<CommunityPanels hot={overview.hot} activeUsers={overview.active_users} />
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* 窄屏:面板下沉到帖子流之后 */}
|
||||
{overview && (
|
||||
<div className="mt-6">
|
||||
<CommunityPanelsMobile
|
||||
stats={overview.stats}
|
||||
hot={overview.hot}
|
||||
activeUsers={overview.active_users}
|
||||
/>
|
||||
<CommunityPanelsMobile hot={overview.hot} activeUsers={overview.active_users} />
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user