fix: desktop layout — use #app flex container (was .app-container with no CSS)
HomeClient rendered className='app-container' but globals.css only defines #app (flex) — sidebar/feed fell back to block layout, feed pushed below. Switch to id='app' to match upstream stylesheet. Also: AdminPage i18n (nav labels + title).
This commit is contained in:
1 parent
0562dd735a
commit
72e93ca5bb
2 files changed
+12
-10
No files matched your search
+1
-1
@@ -34,7 +34,7 @@ function HomeInner() {
|
|||||||
<div className="app-fade-in">
|
<div className="app-fade-in">
|
||||||
<Navbar onOpenModal={openModal} />
|
<Navbar onOpenModal={openModal} />
|
||||||
<ChatManager />
|
<ChatManager />
|
||||||
<div className="app-container">
|
<div id="app">
|
||||||
<Sidebar />
|
<Sidebar />
|
||||||
<Feed onOpenModal={openModal} onReport={openReport} />
|
<Feed onOpenModal={openModal} onReport={openReport} />
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+11
-9
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
// 管理后台:侧边栏布局(对齐上游 main 分支)
|
// 管理后台:侧边栏布局(对齐上游 main 分支)
|
||||||
import { useState } from 'react';
|
import { useState } from 'react';
|
||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
import { Icon } from './Icons';
|
import { Icon } from './Icons';
|
||||||
import AdminReports from './admin/AdminReports';
|
import AdminReports from './admin/AdminReports';
|
||||||
import AdminUsers from './admin/AdminUsers';
|
import AdminUsers from './admin/AdminUsers';
|
||||||
@@ -12,22 +13,23 @@ import AdminCustomPages from './admin/AdminCustomPages';
|
|||||||
import AdminCustomCss from './admin/AdminCustomCss';
|
import AdminCustomCss from './admin/AdminCustomCss';
|
||||||
|
|
||||||
const NAV = [
|
const NAV = [
|
||||||
{ key: 'reports', label: '举报', icon: 'shieldAlert' },
|
{ key: 'reports', labelKey: 'admin.reports', icon: 'shieldAlert' },
|
||||||
{ key: 'users', label: '用户', icon: 'users' },
|
{ key: 'users', labelKey: 'admin.users', icon: 'users' },
|
||||||
{ key: 'logs', label: '日志', icon: 'file' },
|
{ key: 'logs', labelKey: 'admin.logs', icon: 'file' },
|
||||||
{ key: 'links', label: '友链', icon: 'link' },
|
{ key: 'links', labelKey: 'admin.links', icon: 'link' },
|
||||||
{ key: 'settings', label: '论坛设置', icon: 'settings' },
|
{ key: 'settings', labelKey: 'admin.forumSettings', icon: 'settings' },
|
||||||
{ key: 'custom', label: '自定义页面', icon: 'file' },
|
{ key: 'custom', labelKey: 'admin.customPages', icon: 'file' },
|
||||||
{ key: 'css', label: '自定义CSS', icon: 'file' },
|
{ key: 'css', labelKey: 'admin.customCss', icon: 'file' },
|
||||||
];
|
];
|
||||||
|
|
||||||
export default function AdminPage() {
|
export default function AdminPage() {
|
||||||
|
const { t } = useTranslation();
|
||||||
const [tab, setTab] = useState('reports');
|
const [tab, setTab] = useState('reports');
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="page-slide active">
|
<div className="page-slide active">
|
||||||
<div className="page-header" style={{ maxWidth: 1200, margin: '0 auto', width: '100%' }}>
|
<div className="page-header" style={{ maxWidth: 1200, margin: '0 auto', width: '100%' }}>
|
||||||
<h2><Icon name="shieldAlert" size={20} /> 管理后台</h2>
|
<h2><Icon name="shieldAlert" size={20} /> {t('admin.title')}</h2>
|
||||||
</div>
|
</div>
|
||||||
<div className="admin-layout" style={{ maxWidth: 1200, margin: '0 auto', width: '100%' }}>
|
<div className="admin-layout" style={{ maxWidth: 1200, margin: '0 auto', width: '100%' }}>
|
||||||
<aside className="admin-sidebar">
|
<aside className="admin-sidebar">
|
||||||
@@ -41,7 +43,7 @@ export default function AdminPage() {
|
|||||||
onClick={(e) => { e.preventDefault(); setTab(n.key); }}
|
onClick={(e) => { e.preventDefault(); setTab(n.key); }}
|
||||||
>
|
>
|
||||||
<span className="nav-icon"><Icon name={n.icon} size={18} /></span>
|
<span className="nav-icon"><Icon name={n.icon} size={18} /></span>
|
||||||
{n.label}
|
{t(n.labelKey)}
|
||||||
</a>
|
</a>
|
||||||
))}
|
))}
|
||||||
</nav>
|
</nav>
|
||||||
|
|||||||
Reference in new issue
Block a user