Skip to content

Commit f0b4908

Browse files
committed
Refactor upload to LoadingElement
1 parent 2bcb14d commit f0b4908

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

components/dash-core-components/src/fragments/Upload.react.js

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React, {Component} from 'react';
22
import Dropzone from 'react-dropzone';
33

44
import {propTypes, defaultProps} from '../components/Upload.react';
5+
import LoadingElement from '../utils/LoadingElement';
56

67
export default class Upload extends Component {
78
constructor() {
@@ -62,15 +63,9 @@ export default class Upload extends Component {
6263
style_active,
6364
style_reject,
6465
style_disabled,
65-
loading_state,
6666
} = this.props;
6767
return (
68-
<div
69-
id={id}
70-
data-dash-is-loading={
71-
(loading_state && loading_state.is_loading) || undefined
72-
}
73-
>
68+
<LoadingElement id={id}>
7469
<Dropzone
7570
onDrop={this.onDrop}
7671
accept={accept}
@@ -90,7 +85,7 @@ export default class Upload extends Component {
9085
>
9186
{children}
9287
</Dropzone>
93-
</div>
88+
</LoadingElement>
9489
);
9590
}
9691
}

0 commit comments

Comments
 (0)