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
This commit is contained in:
lezi-fun committed 2026-08-10 12:35:50 +08:00
1 parent 721e4bfe42
commit 48372aa14f
14 files changed
+371 -10

No files matched your search

+7
View File
@@ -16,6 +16,13 @@ export default function Navbar({ onOpenModal }) {
API.getCustomPages().then(setCustomPages).catch(() => {});
}, []);
// 点击菜单外部关闭下拉(与原版行为一致)
useEffect(() => {
const closeMenu = () => setMenuOpen(false);
document.addEventListener('click', closeMenu);
return () => document.removeEventListener('click', closeMenu);
}, []);
const avatarSrc = currentUser?.avatar_url ||
'https://ui-avatars.com/api/?name=' + encodeURIComponent(currentUser?.username || 'U') +
'&background=6366f1&color=fff';