Commit b4858a6a authored by ι™ˆεΈ…'s avatar ι™ˆεΈ…

fix #1945 and use Skeleton replace card

parent fc939795
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
}, },
"dependencies": { "dependencies": {
"@antv/data-set": "^0.9.0", "@antv/data-set": "^0.9.0",
"antd": "^3.8.2", "antd": "^3.9.0-beta.0",
"bizcharts": "^3.1.10", "bizcharts": "^3.1.10",
"bizcharts-plugin-slider": "^2.0.3", "bizcharts-plugin-slider": "^2.0.3",
"classnames": "^2.2.6", "classnames": "^2.2.6",
......
import React, { PureComponent, createElement } from 'react'; import React, { PureComponent, createElement } from 'react';
import pathToRegexp from 'path-to-regexp'; import pathToRegexp from 'path-to-regexp';
import { Breadcrumb, Tabs, Card } from 'antd'; import { Breadcrumb, Tabs, Skeleton } from 'antd';
import classNames from 'classnames'; import classNames from 'classnames';
import styles from './index.less'; import styles from './index.less';
import { urlToList } from '../_utils/pathTools'; import { urlToList } from '../_utils/pathTools';
...@@ -200,7 +200,8 @@ export default class PageHeader extends PureComponent { ...@@ -200,7 +200,8 @@ export default class PageHeader extends PureComponent {
activeKeyProps.activeKey = tabActiveKey; activeKeyProps.activeKey = tabActiveKey;
} }
return ( return (
<Card className={clsString} bodyStyle={{ padding: 0 }} loading={loading}> <div className={clsString}>
<Skeleton loading={loading}>
{breadcrumb} {breadcrumb}
<div className={styles.detail}> <div className={styles.detail}>
{logo && <div className={styles.logo}>{logo}</div>} {logo && <div className={styles.logo}>{logo}</div>}
...@@ -227,7 +228,8 @@ export default class PageHeader extends PureComponent { ...@@ -227,7 +228,8 @@ export default class PageHeader extends PureComponent {
))} ))}
</Tabs> </Tabs>
) : null} ) : null}
</Card> </Skeleton>
</div>
); );
} }
} }
...@@ -27,6 +27,11 @@ body { ...@@ -27,6 +27,11 @@ body {
margin: 40px 0 !important; margin: 40px 0 !important;
} }
ul,
ol {
list-style: none;
}
:global { :global {
body .ant-drawer .ant-drawer-content { body .ant-drawer .ant-drawer-content {
opacity: 1; opacity: 1;
......
...@@ -71,6 +71,7 @@ class BasicLayout extends React.PureComponent { ...@@ -71,6 +71,7 @@ class BasicLayout extends React.PureComponent {
super(props); super(props);
const { menuData } = this.props; const { menuData } = this.props;
this.getPageTitle = memoizeOne(this.getPageTitle); this.getPageTitle = memoizeOne(this.getPageTitle);
// Because there are many places to be. So put it here
this.breadcrumbNameMap = getBreadcrumbNameMap(menuData); this.breadcrumbNameMap = getBreadcrumbNameMap(menuData);
} }
getContext() { getContext() {
...@@ -80,6 +81,10 @@ class BasicLayout extends React.PureComponent { ...@@ -80,6 +81,10 @@ class BasicLayout extends React.PureComponent {
breadcrumbNameMap: this.breadcrumbNameMap, breadcrumbNameMap: this.breadcrumbNameMap,
}; };
} }
componentDidUpdate() {
const { menuData } = this.props;
this.breadcrumbNameMap = getBreadcrumbNameMap(menuData);
}
getPageTitle = pathname => { getPageTitle = pathname => {
let currRouterData = null; let currRouterData = null;
// match params path // match params path
......
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