Skip to content

Commit

Permalink
add loading spinner on upload image
Browse files Browse the repository at this point in the history
  • Loading branch information
rakeshkumar1019 committed Nov 24, 2023
1 parent 60f94fa commit c8d0e0e
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/components/Board/TileEditor/TileEditor.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import KeyboardArrowLeftIcon from '@material-ui/icons/KeyboardArrowLeft';
import Select from '@material-ui/core/Select';
import MenuItem from '@material-ui/core/MenuItem';
import InputLabel from '@material-ui/core/InputLabel';
import CircularProgress from '@material-ui/core/CircularProgress';

import messages from './TileEditor.messages';
import SymbolSearch from '../SymbolSearch';
Expand Down Expand Up @@ -107,7 +108,8 @@ export class TileEditor extends Component {
tile: this.defaultTile,
linkedBoard: '',
imageUploadedData: [],
isEditImageBtnActive: false
isEditImageBtnActive: false,
loading: false
};

this.defaultimageUploadedData = {
Expand Down Expand Up @@ -289,6 +291,9 @@ export class TileEditor extends Component {
};

setimageUploadedData = (isUploaded, fileName, blobHQ = null, blob = null) => {
this.setState({
loading: true
});
const { activeStep } = this.state;
let imageUploadedData = this.state.imageUploadedData.map((item, indx) => {
if (indx === activeStep) {
Expand All @@ -304,6 +309,9 @@ export class TileEditor extends Component {
}
});
this.setState({ imageUploadedData: imageUploadedData });
this.setState({
loading: false
});
};

handleSymbolSearchChange = ({ image, labelKey, label, keyPath }) => {
Expand Down Expand Up @@ -523,11 +531,15 @@ export class TileEditor extends Component {
Boolean(tileInView.loadBoard) ? 'folder' : 'button'
}
>
<Symbol
{
this.state.loading
? <CircularProgress/>
: <Symbol
image={tileInView.image}
label={currentLabel}
keyPath={tileInView.keyPath}
/>
}
</Tile>
</div>
{this.state.isEditImageBtnActive && (
Expand Down

0 comments on commit c8d0e0e

Please sign in to comment.