feat: 帖子收藏与用户关注

- 新增收藏功能:favorite 服务与 handler、FavoriteButton 组件
- 新增关注功能:follow 服务与 handler、FollowButton 组件
- 用户主页适配关注/粉丝与收藏展示
- flash 消息工具、广告与侧边栏组件微调
This commit is contained in:
2026-09-26 03:02:40 +08:00
parent 31f5360c26
commit d7c6b3a961
40 changed files with 1528 additions and 268 deletions

View File

@@ -34,7 +34,13 @@ import { FRIEND_LINKS } from "@/lib/friendLinks";
import { formatCompact, formatShortDate } from "@/lib/format";
import { pageGlyph } from "@/lib/pageGlyph";
import { AboutSiteHeader } from "@/components/site-doc";
import { AD_IMAGE_HEIGHT, AD_IMAGE_SIZE_LABEL, AD_IMAGE_WIDTH } from "@/lib/ads";
import {
AD_IMAGE_HEIGHT,
AD_IMAGE_SIZE_LABEL,
AD_IMAGE_WIDTH,
AD_TIP_DELAY_MS,
adHoverTip,
} from "@/lib/ads";
/* ---------- 站点数据(2×2 bento 统计瓦片) ---------- */
@@ -464,10 +470,7 @@ export function AdsPanel({
<p className="j13-module-title mb-3">
<CircleDollarSign size={15} style={{ color: "var(--accent)" }} />
{title || "自助推广"}
<Link
href="/ads/buy"
className="meta ml-auto text-[12px] font-normal transition-colors hover:text-[var(--accent)]"
>
<Link href="/ads/buy" className="j13-ad-buy-btn ml-auto">
购买广告位
</Link>
</p>
@@ -482,6 +485,8 @@ export function AdsPanel({
target="_blank"
rel="noopener noreferrer sponsored"
className="j13-ad-image-link"
data-tip={adHoverTip(ad.ends_at)}
data-tip-delay={AD_TIP_DELAY_MS}
>
{/* eslint-disable-next-line @next/next/no-img-element */}
<img
@@ -513,6 +518,7 @@ export function AdsPanel({
textColor={ad.text_color || "#1E293B"}
bgColor={ad.bg_color || "#F1F5F9"}
href={ad.link_url}
endsAt={ad.ends_at}
/>
</li>
) : (