Files
forumlify/components/CustomCssLoader.js
lezi-fun 4ee38f6486 feat: align with upstream — pin posts, edit marker, custom CSS, UX fixes
- Pin/unpin posts (PUT /api/posts/:id/pin, admin) with notification to author
- is_pinned/pinned_at in schema; 📌 badge on feed + detail; admin pin button
- Edited marker (已编辑) on feed + detail; edit button + modal for authors
- Custom CSS: upload/delete API + admin tab + global loader (style.css override)
- Fix: duplicate post title on detail page (remove card title, keep header)
- Fix: forum name flicker on load (localStorage cache before fetch)
- Fix: dropdown menu closes on outside click (document listener)
- Fix: document.title + <title> sync on forum rename
2026-08-10 12:32:06 +08:00

18 lines
477 B
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
'use client';
// 加载自定义 CSS(管理员上传的 style.css,覆盖默认样式)
import { useEffect } from 'react';
export default function CustomCssLoader() {
useEffect(() => {
// 尝试加载 /api/custom-css;404 表示未设置,静默跳过
const link = document.createElement('link');
link.rel = 'stylesheet';
link.href = '/api/custom-css';
link.id = 'custom-css-link';
document.head.appendChild(link);
}, []);
return null;
}