Commit 189c5882 authored by 陈帅's avatar 陈帅 Committed by 陈小聪

remove PureComponent (#3470)

* remove PureComponent

* fix typo
parent b095b0bc
...@@ -51,7 +51,7 @@ export default class SiderMenu extends PureComponent { ...@@ -51,7 +51,7 @@ export default class SiderMenu extends PureComponent {
const defaultProps = collapsed ? {} : { openKeys }; const defaultProps = collapsed ? {} : { openKeys };
const siderClassName = classNames(styles.sider, { const siderClassName = classNames(styles.sider, {
[styles.fixSiderbar]: fixSiderbar, [styles.fixSiderBar]: fixSiderbar,
[styles.light]: theme === 'light', [styles.light]: theme === 'light',
}); });
return ( return (
......
...@@ -25,13 +25,13 @@ ...@@ -25,13 +25,13 @@
font-weight: 600; font-weight: 600;
} }
} }
.sider { .sider {
min-height: 100vh; min-height: 100vh;
box-shadow: 2px 0 6px rgba(0, 21, 41, 0.35); box-shadow: 2px 0 6px rgba(0, 21, 41, 0.35);
position: relative; position: relative;
z-index: 10; z-index: 10;
&.fixSiderbar { &.fixSiderBar {
box-shadow: 2px 0 8px 0 rgba(29, 35, 41, 0.05);
position: fixed; position: fixed;
top: 0; top: 0;
left: 0; left: 0;
......
...@@ -51,7 +51,7 @@ const query = { ...@@ -51,7 +51,7 @@ const query = {
}, },
}; };
class BasicLayout extends React.PureComponent { class BasicLayout extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.getPageTitle = memoizeOne(this.getPageTitle); this.getPageTitle = memoizeOne(this.getPageTitle);
......
import React, { PureComponent } from 'react'; import React, { Component } from 'react';
import { formatMessage } from 'umi/locale'; import { formatMessage } from 'umi/locale';
import { Layout, message } from 'antd'; import { Layout, message } from 'antd';
import Animate from 'rc-animate'; import Animate from 'rc-animate';
...@@ -10,7 +10,7 @@ import styles from './Header.less'; ...@@ -10,7 +10,7 @@ import styles from './Header.less';
const { Header } = Layout; const { Header } = Layout;
class HeaderView extends PureComponent { class HeaderView extends Component {
state = { state = {
visible: true, visible: true,
}; };
......
...@@ -31,21 +31,7 @@ const copyright = ( ...@@ -31,21 +31,7 @@ const copyright = (
</Fragment> </Fragment>
); );
class UserLayout extends React.PureComponent { const UserLayout = ({ children }) => (
// @TODO title
// getPageTitle() {
// const { routerData, location } = this.props;
// const { pathname } = location;
// let title = 'Ant Design Pro';
// if (routerData[pathname] && routerData[pathname].name) {
// title = `${routerData[pathname].name} - Ant Design Pro`;
// }
// return title;
// }
render() {
const { children } = this.props;
return (
// @TODO <DocumentTitle title={this.getPageTitle()}> // @TODO <DocumentTitle title={this.getPageTitle()}>
<div className={styles.container}> <div className={styles.container}>
<div className={styles.lang}> <div className={styles.lang}>
...@@ -65,8 +51,6 @@ class UserLayout extends React.PureComponent { ...@@ -65,8 +51,6 @@ class UserLayout extends React.PureComponent {
</div> </div>
<GlobalFooter links={links} copyright={copyright} /> <GlobalFooter links={links} copyright={copyright} />
</div> </div>
); );
}
}
export default UserLayout; export default UserLayout;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment