mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-24 19:19:57 +08:00
docs: fix menu bg (#39649)
This commit is contained in:
parent
862231d07b
commit
4714f851d4
@ -1,6 +1,6 @@
|
||||
import React, { useContext } from 'react';
|
||||
import { useSidebarData } from 'dumi';
|
||||
import { Affix, Col, Menu } from 'antd';
|
||||
import { Affix, Col, ConfigProvider, Menu } from 'antd';
|
||||
import MobileMenu from 'rc-drawer';
|
||||
import { css } from '@emotion/react';
|
||||
import SiteContext from '../SiteContext';
|
||||
@ -131,17 +131,22 @@ const Sidebar: React.FC = () => {
|
||||
|
||||
const [menuItems, selectedKey] = useMenu();
|
||||
const isDark = theme.includes('dark');
|
||||
const {
|
||||
token: { colorBgContainer },
|
||||
} = useSiteToken();
|
||||
|
||||
const menuChild = (
|
||||
<Menu
|
||||
items={menuItems}
|
||||
inlineIndent={30}
|
||||
css={styles.asideContainer}
|
||||
mode="inline"
|
||||
theme={isDark ? 'dark' : 'light'}
|
||||
selectedKeys={[selectedKey]}
|
||||
defaultOpenKeys={sidebarData?.map(({ title }) => title).filter((item) => item) as string[]}
|
||||
/>
|
||||
<ConfigProvider theme={{ components: { Menu: { colorItemBg: colorBgContainer } } }}>
|
||||
<Menu
|
||||
items={menuItems}
|
||||
inlineIndent={30}
|
||||
css={styles.asideContainer}
|
||||
mode="inline"
|
||||
theme={isDark ? 'dark' : 'light'}
|
||||
selectedKeys={[selectedKey]}
|
||||
defaultOpenKeys={sidebarData?.map(({ title }) => title).filter((item) => item) as string[]}
|
||||
/>
|
||||
</ConfigProvider>
|
||||
);
|
||||
|
||||
return isMobile ? (
|
||||
|
Loading…
Reference in New Issue
Block a user