From 304722999854c08f0774a4fe9f5cf5328fe4bbf0 Mon Sep 17 00:00:00 2001 From: afc163 Date: Tue, 31 Oct 2017 10:41:22 +0800 Subject: [PATCH] Remove spinning of analysis page cards --- src/components/Charts/ChartCard/index.js | 10 ++++------ src/routes/Dashboard/Analysis.js | 10 +--------- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/src/components/Charts/ChartCard/index.js b/src/components/Charts/ChartCard/index.js index 5624f21f..2a486d68 100644 --- a/src/components/Charts/ChartCard/index.js +++ b/src/components/Charts/ChartCard/index.js @@ -3,7 +3,9 @@ import { Card, Spin } from 'antd'; import styles from './index.less'; -const ChartCard = ({ loading, contentHeight, title, action, total, footer, children, ...rest }) => { +const ChartCard = ({ + loading = false, contentHeight, title, action, total, footer, children, ...rest +}) => { const content = (
@@ -34,11 +36,7 @@ const ChartCard = ({ loading, contentHeight, title, action, total, footer, child bodyStyle={{ padding: '20px 24px 8px 24px' }} {...rest} > - { - loading ? ( - {content} - ) : content - } + {{content}} ); }; diff --git a/src/routes/Dashboard/Analysis.js b/src/routes/Dashboard/Analysis.js index 00e4b80f..703ef774 100644 --- a/src/routes/Dashboard/Analysis.js +++ b/src/routes/Dashboard/Analysis.js @@ -36,11 +36,7 @@ export default class Analysis extends Component { componentDidMount() { this.props.dispatch({ type: 'chart/fetch', - }).then(() => { - this.setState({ - loading: false, - }); - }); + }).then(() => this.setState({ loading: false })); } componentWillUnmount() { @@ -226,7 +222,6 @@ export default class Analysis extends Component { } @@ -244,7 +239,6 @@ export default class Analysis extends Component { } @@ -261,7 +255,6 @@ export default class Analysis extends Component { } @@ -277,7 +270,6 @@ export default class Analysis extends Component { } -- GitLab