feat: 侧边栏默认亮色主题,暗黑主题下跟随切换
This commit is contained in:
@@ -15,6 +15,7 @@ export function AppLayout() {
|
||||
const location = useLocation();
|
||||
const navigate = useNavigate();
|
||||
const { effectiveThemeId } = useTheme();
|
||||
const isDark = effectiveThemeId === 'dark';
|
||||
const [collapsed, setCollapsed] = useState(false);
|
||||
|
||||
const getPageTitle = () => {
|
||||
@@ -31,6 +32,7 @@ export function AppLayout() {
|
||||
collapsed={collapsed}
|
||||
onCollapse={setCollapsed}
|
||||
breakpoint="lg"
|
||||
theme={isDark ? 'dark' : 'light'}
|
||||
style={{
|
||||
overflow: 'hidden',
|
||||
height: '100vh',
|
||||
@@ -47,7 +49,7 @@ export function AppLayout() {
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
color: '#fff',
|
||||
color: isDark ? '#fff' : 'rgba(0, 0, 0, 0.88)',
|
||||
fontSize: collapsed ? '1rem' : '1.25rem',
|
||||
fontWeight: 600,
|
||||
transition: 'all 0.2s',
|
||||
@@ -57,7 +59,7 @@ export function AppLayout() {
|
||||
{collapsed ? 'AI' : 'AI Gateway'}
|
||||
</div>
|
||||
<Menu
|
||||
theme="dark"
|
||||
theme={isDark ? 'dark' : 'light'}
|
||||
mode="inline"
|
||||
selectedKeys={[location.pathname]}
|
||||
items={menuItems}
|
||||
|
||||
Reference in New Issue
Block a user