feat(shell): ConsoleShell 传递 compact 给 buildThemeConfig
This commit is contained in:
@@ -18,7 +18,7 @@ import { ConsoleOutlet } from "./ConsoleOutlet";
|
||||
const { Content, Header, Sider } = Layout;
|
||||
|
||||
export function ConsoleShell({ headerExtra, menuItems, title }: ConsoleShellProps) {
|
||||
const { effectiveTheme } = useThemePreference();
|
||||
const { compact, effectiveTheme } = useThemePreference();
|
||||
const { collapsed, setCollapsed } = useSidebarCollapsed();
|
||||
const { data: meta } = useMeta();
|
||||
|
||||
@@ -26,7 +26,7 @@ export function ConsoleShell({ headerExtra, menuItems, title }: ConsoleShellProp
|
||||
const locale = useMemo(() => ({ ...zhCN, ...zhCN_X }), []);
|
||||
|
||||
return (
|
||||
<XProvider locale={locale} theme={buildThemeConfig(effectiveTheme)}>
|
||||
<XProvider locale={locale} theme={buildThemeConfig({ compact, effectiveTheme })}>
|
||||
<AntApp>
|
||||
<Layout className="app-layout">
|
||||
<Header className="app-header">
|
||||
|
||||
@@ -6,7 +6,7 @@ import { ConsoleShell } from "../../../src/web/shared/components/ConsoleShell/Co
|
||||
import { installFetchMock, jsonResponse, mockMetaResponse, renderWithProviders } from "../test-utils";
|
||||
|
||||
function mockSettingsResponse(): Response {
|
||||
return jsonResponse({ theme: "system" });
|
||||
return jsonResponse({ compact: false, theme: "system" });
|
||||
}
|
||||
|
||||
describe("ConsoleShell", () => {
|
||||
|
||||
Reference in New Issue
Block a user