diff --git a/src/components/SiderMenu/SiderMenu.js b/src/components/SiderMenu/SiderMenu.js index 8c2f77d1177f92427c83e6abf64bfd73a31f4cf2..7ef31536807a64670ec4bc30fbc13ae0df038aa4 100644 --- a/src/components/SiderMenu/SiderMenu.js +++ b/src/components/SiderMenu/SiderMenu.js @@ -2,6 +2,7 @@ import React, { PureComponent } from 'react'; import { Layout, Menu, Icon } from 'antd'; import pathToRegexp from 'path-to-regexp'; import { Link } from 'dva/router'; +import classNames from 'classnames'; import styles from './index.less'; import { urlToList } from '../_utils/pathTools'; @@ -75,8 +76,7 @@ export default class SiderMenu extends PureComponent { getDefaultCollapsedSubMenus(props) { const { location: { pathname }, - } = - props || this.props; + } = props || this.props; return getMenuMatchKeys(this.flatMenuKeys, urlToList(pathname)); } @@ -212,6 +212,10 @@ export default class SiderMenu extends PureComponent { render() { const { logo, menuData, collapsed, onCollapse } = this.props; const { openKeys } = this.state; + const theme = 'dark'; + const siderClass = classNames(styles.sider, { + [styles.light]: theme === 'light', + }); // Don't show popup menu when it is been collapsed const menuProps = collapsed ? {} @@ -231,7 +235,7 @@ export default class SiderMenu extends PureComponent { breakpoint="lg" onCollapse={onCollapse} width={256} - className={styles.sider} + className={siderClass} >
@@ -241,7 +245,7 @@ export default class SiderMenu extends PureComponent {