feat: 新增排行榜模块

- 新增 leaderboard 服务与 handler、前端排行榜页面
- 路由与首页入口适配
This commit is contained in:
2026-09-25 18:28:12 +08:00
parent 4ae57d9392
commit cab8230803
9 changed files with 1112 additions and 2 deletions

View File

@@ -14,6 +14,7 @@ import {
Settings,
Bell,
Home,
Trophy,
User as UserIcon,
ChevronDown,
ShieldCheck,
@@ -241,6 +242,13 @@ export default function Header({
<NavPill href="/" active={pathname === "/"} icon={<Home size={15} />}>
首页
</NavPill>
<NavPill
href="/leaderboard"
active={pathname?.startsWith("/leaderboard") ?? false}
icon={<Trophy size={15} />}
>
排行榜
</NavPill>
</nav>
</div>
@@ -366,6 +374,11 @@ export default function Header({
</form>
<div className="flex flex-col">
<MobileLink href="/" active={pathname === "/"}>首页</MobileLink>
<MobileLink href="/leaderboard" active={pathname?.startsWith("/leaderboard") ?? false}>
<span className="inline-flex items-center gap-2">
<Trophy size={15} /> 排行榜
</span>
</MobileLink>
{user && !hideComposeNav && <MobileLink href="/compose">发帖</MobileLink>}
{user && allowMessages && (
<MobileLink href="/chat" active={pathname?.startsWith("/chat") ?? false}>