fix: user profile avatar + loading spinners + modal opacity
- UserProfile now uses avatar_url (was always default ui-avatars) - Loading states show spinner-sm spinner instead of plain text (Feed, UserProfile, chat, admin panels, custom pages) - Modal background: semi-transparent glass (0.85 light / 0.88 dark)
This commit is contained in:
1 parent
bfe8a80822
commit
74202f7551
10 files changed
+30
-11
No files matched your search
@@ -24,7 +24,7 @@ export default function CustomPage({ pageName }) {
|
||||
);
|
||||
}
|
||||
if (html === null) {
|
||||
return <div style={{ padding: '84px 32px', textAlign: 'center', color: '#94a3b8' }}>加载中...</div>;
|
||||
return <div style={{ padding: '84px 32px', textAlign: 'center', color: '#94a3b8' }}><span className="spinner-sm" />加载中...</div>;
|
||||
}
|
||||
|
||||
const srcdoc = `<!DOCTYPE html>
|
||||
|
||||
+1
-1
@@ -85,7 +85,7 @@ export default function Feed({ onOpenModal, onReport }) {
|
||||
</div>
|
||||
<div id="postList" ref={postListRef}>
|
||||
{posts === null ? (
|
||||
<div style={{ textAlign: 'center', color: '#94a3b8', padding: '40px 0' }}>加载中...</div>
|
||||
<div style={{ textAlign: 'center', color: '#94a3b8', padding: '40px 0' }}><span className="spinner-sm" />加载中...</div>
|
||||
) : error ? (
|
||||
<div style={{ textAlign: 'center', color: '#ef4444', padding: '40px 0' }}>加载失败:{error}</div>
|
||||
) : posts.length === 0 ? (
|
||||
|
||||
@@ -45,7 +45,7 @@ export default function UserProfile({ username }) {
|
||||
);
|
||||
}
|
||||
if (!user) {
|
||||
return <div style={{ textAlign: 'center', color: '#94a3b8', padding: '40px 0' }}>加载中...</div>;
|
||||
return <div style={{ textAlign: 'center', color: '#94a3b8', padding: '40px 0' }}><span className="spinner-sm" />加载中...</div>;
|
||||
}
|
||||
|
||||
return (
|
||||
@@ -55,7 +55,7 @@ export default function UserProfile({ username }) {
|
||||
</div>
|
||||
<div style={{ maxWidth: 700, margin: '0 auto', width: '100%' }}>
|
||||
<div style={{ background: 'var(--surface)', border: '1px solid var(--border)', borderRadius: 8, padding: 32, textAlign: 'center' }}>
|
||||
<img src={avatar(user.username)} style={{ width: 96, height: 96, borderRadius: '50%', objectFit: 'cover', border: '3px solid var(--primary)' }} alt="" />
|
||||
<img src={user.avatar_url || avatar(user.username)} style={{ width: 96, height: 96, borderRadius: '50%', objectFit: 'cover', border: '3px solid var(--primary)' }} alt="" />
|
||||
<h2 style={{ margin: '16px 0 4px', fontSize: 24 }}>{user.username}</h2>
|
||||
<p style={{ color: 'var(--text-secondary)', fontSize: 14 }}>{user.bio || '这个人很懒,什么都没写'}</p>
|
||||
{currentUser && currentUser.id !== user.id && (
|
||||
|
||||
@@ -38,7 +38,7 @@ export default function AdminCustomPages() {
|
||||
</div>
|
||||
<div id="customPageList">
|
||||
{pages === null ? (
|
||||
<div style={{ textAlign: 'center', color: '#94a3b8', padding: 20 }}>加载中...</div>
|
||||
<div style={{ textAlign: 'center', color: '#94a3b8', padding: 20 }}><span className="spinner-sm" />加载中...</div>
|
||||
) : pages.length === 0 ? (
|
||||
<div style={{ textAlign: 'center', color: '#94a3b8', padding: 20 }}>暂无自定义页面</div>
|
||||
) : (
|
||||
|
||||
@@ -17,7 +17,7 @@ export default function AdminLogs() {
|
||||
useEffect(load, []);
|
||||
|
||||
if (error) return <div style={{ textAlign: 'center', color: '#ef4444', padding: 20 }}>加载失败:{error}</div>;
|
||||
if (!logs) return <div style={{ textAlign: 'center', color: '#94a3b8', padding: 20 }}>加载中...</div>;
|
||||
if (!logs) return <div style={{ textAlign: 'center', color: '#94a3b8', padding: 20 }}><span className="spinner-sm" />加载中...</div>;
|
||||
if (logs.length === 0) return <div style={{ textAlign: 'center', color: '#94a3b8', padding: 40 }}>暂无日志</div>;
|
||||
|
||||
return (
|
||||
|
||||
@@ -35,7 +35,7 @@ export default function AdminReports() {
|
||||
};
|
||||
|
||||
if (error) return <div style={{ textAlign: 'center', color: '#ef4444', padding: 20 }}>加载失败:{error}</div>;
|
||||
if (!reports) return <div style={{ textAlign: 'center', color: '#94a3b8', padding: 20 }}>加载中...</div>;
|
||||
if (!reports) return <div style={{ textAlign: 'center', color: '#94a3b8', padding: 20 }}><span className="spinner-sm" />加载中...</div>;
|
||||
if (reports.length === 0) return <div style={{ textAlign: 'center', color: '#94a3b8', padding: 40 }}>✅ 暂无举报</div>;
|
||||
|
||||
return reports.map((r) => (
|
||||
|
||||
@@ -30,7 +30,7 @@ export default function AdminUsers() {
|
||||
};
|
||||
|
||||
if (error) return <div style={{ textAlign: 'center', color: '#ef4444', padding: 20 }}>加载失败:{error}</div>;
|
||||
if (!users) return <div style={{ textAlign: 'center', color: '#94a3b8', padding: 20 }}>加载中...</div>;
|
||||
if (!users) return <div style={{ textAlign: 'center', color: '#94a3b8', padding: 20 }}><span className="spinner-sm" />加载中...</div>;
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
@@ -60,7 +60,7 @@ export default function ChatWindow({ conversationId, otherUserId, otherUsername,
|
||||
</div>
|
||||
<div id="chatMessages" ref={containerRef} style={{ flex: 1, overflowY: 'auto', padding: 16, minHeight: 0 }}>
|
||||
{messages === null ? (
|
||||
<div style={{ textAlign: 'center', color: '#94a3b8', padding: '40px 0' }}>加载中...</div>
|
||||
<div style={{ textAlign: 'center', color: '#94a3b8', padding: '40px 0' }}><span className="spinner-sm" />加载中...</div>
|
||||
) : messages.length === 0 ? (
|
||||
<div style={{ textAlign: 'center', color: '#94a3b8', padding: '40px 0' }}>还没有消息,打个招呼吧 👋</div>
|
||||
) : (
|
||||
|
||||
@@ -29,7 +29,7 @@ export default function ConversationList({ onOpenChat, onClose }) {
|
||||
</div>
|
||||
<div id="messageListContent" style={{ flex: 1, overflowY: 'auto', padding: 0 }}>
|
||||
{conversations === null ? (
|
||||
<div style={{ textAlign: 'center', color: '#94a3b8', padding: '40px 0' }}>加载中...</div>
|
||||
<div style={{ textAlign: 'center', color: '#94a3b8', padding: '40px 0' }}><span className="spinner-sm" />加载中...</div>
|
||||
) : conversations.length === 0 ? (
|
||||
<div style={{ textAlign: 'center', color: '#94a3b8', padding: '40px 0' }}>暂无私信</div>
|
||||
) : (
|
||||
|
||||
Reference in new issue
Block a user