Commit c3dfe2eb authored by afc163's avatar afc163

fix indent

parent d091cf4d
...@@ -2,38 +2,38 @@ import React from 'react'; ...@@ -2,38 +2,38 @@ import React from 'react';
import { Spin } from 'antd'; import { Spin } from 'antd';
export default class PromiseRender extends React.PureComponent { export default class PromiseRender extends React.PureComponent {
state = { state = {
component: false, component: false,
}; };
async componentDidMount() { async componentDidMount() {
this.props.promise this.props.promise
.then(() => { .then(() => {
this.setState({ this.setState({
component: this.props.ok, component: this.props.ok,
});
})
.catch(() => {
this.setState({
component: this.props.error,
});
}); });
} })
render() { .catch(() => {
const C = this.state.component; this.setState({
return C ? ( component: this.props.error,
<C {...this.props} /> });
) : ( });
<div }
style={{ render() {
width: '100%', const C = this.state.component;
height: '100%', return C ? (
margin: 'auto', <C {...this.props} />
paddingTop: 50, ) : (
textAlign: 'center', <div
}} style={{
> width: '100%',
<Spin size="large" /> height: '100%',
</div> margin: 'auto',
); paddingTop: 50,
} textAlign: 'center',
}}
>
<Spin size="large" />
</div>
);
}
} }
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