fix: restore original Feather icons across UI
- Add components/Icons.js with SVG paths extracted verbatim from the original index.html (14 unique icons) - Restore icons on navbar menu, sidebar, feed actions, post/reply, modals, admin tabs and settings - Replaces emoji placeholders from the initial migration
This commit is contained in:
1 parent
3e9d004fb6
commit
70a198ae32
14 files changed
+160
-35
No files matched your search
+12
-5
@@ -4,6 +4,7 @@
|
||||
import { useEffect, useState, useCallback } from 'react';
|
||||
import { API } from '@/lib/api';
|
||||
import { useApp } from './AppProvider';
|
||||
import { Icon } from './Icons';
|
||||
|
||||
function avatar(username) {
|
||||
return 'https://ui-avatars.com/api/?name=' + encodeURIComponent(username || '匿名用户') +
|
||||
@@ -12,7 +13,7 @@ function avatar(username) {
|
||||
|
||||
export default function Feed({ onOpenModal, onReport }) {
|
||||
const { currentUser, sort, setSort, openPost, navigate, refreshKey } = useApp();
|
||||
const [posts, setPosts] = useState(null); // null = loading
|
||||
const [posts, setPosts] = useState(null);
|
||||
const [error, setError] = useState(null);
|
||||
|
||||
const load = useCallback(async () => {
|
||||
@@ -53,7 +54,7 @@ export default function Feed({ onOpenModal, onReport }) {
|
||||
navigate('new');
|
||||
}}
|
||||
>
|
||||
发布新帖
|
||||
<Icon name="plus" /> 发布新帖
|
||||
</button>
|
||||
</div>
|
||||
<div id="postList">
|
||||
@@ -82,17 +83,23 @@ export default function Feed({ onOpenModal, onReport }) {
|
||||
</div>
|
||||
)}
|
||||
<div className="post-actions">
|
||||
<span>💬 {p.reply_count || 0}</span>
|
||||
<span>
|
||||
<Icon name="message" size={14} /> {p.reply_count || 0}
|
||||
</span>
|
||||
<button className="action-report" onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
if (!currentUser) { alert('请先登录'); return; }
|
||||
onReport(p.id);
|
||||
}}>举报</button>
|
||||
}}>
|
||||
<Icon name="flag" size={14} /> 举报
|
||||
</button>
|
||||
{currentUser && currentUser.id === p.user_id && (
|
||||
<button className="action-delete" onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
handleDelete(p.id);
|
||||
}}>删除</button>
|
||||
}}>
|
||||
<Icon name="trash" size={14} /> 删除
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user