update conditional renderings

This commit is contained in:
Abhinav 2022-05-26 13:54:04 +05:30
parent 4a5b353b2b
commit ef44b865ab
3 changed files with 87 additions and 88 deletions

View file

@ -32,10 +32,9 @@ export function UploadProgressDialog({
fileCounter={props.fileCounter}
now={props.now}
/>
<DialogContent
sx={{
'&&&': { px: 0 },
}}>
{(props.uploadStage === UPLOAD_STAGES.UPLOADING ||
props.uploadStage === UPLOAD_STAGES.FINISH) && (
<DialogContent>
{props.uploadStage === UPLOAD_STAGES.UPLOADING && (
<InProgressSection
filenames={props.filenames}
@ -90,7 +89,9 @@ export function UploadProgressDialog({
sectionTitle={
constants.LARGER_THAN_AVAILABLE_STORAGE_UPLOADS
}
sectionInfo={constants.LARGER_THAN_AVAILABLE_STORAGE_INFO}
sectionInfo={
constants.LARGER_THAN_AVAILABLE_STORAGE_INFO
}
/>
<ResultSection
filenames={props.filenames}
@ -107,7 +108,7 @@ export function UploadProgressDialog({
sectionInfo={constants.TOO_LARGE_INFO}
/>
</DialogContent>
)}
{props.uploadStage === UPLOAD_STAGES.FINISH && (
<UploadProgressFooter
uploadStage={props.uploadStage}

View file

@ -19,11 +19,7 @@ export function UploadProgressHeader({
handleHideModal={handleHideModal}
fileCounter={fileCounter}
/>
<UploadProgressBar
now={now}
uploadStage={uploadStage}
expanded={expanded}
/>
<UploadProgressBar now={now} uploadStage={uploadStage} />
</>
);
}

View file

@ -2,12 +2,13 @@ import React from 'react';
import { LinearProgress, Divider, Box } from '@mui/material';
import { UPLOAD_STAGES } from 'constants/upload';
export function UploadProgressBar({ uploadStage, now, expanded }) {
export function UploadProgressBar({ uploadStage, now }) {
return (
<Box mb={expanded ? 2 : 0}>
<Box>
{(uploadStage === UPLOAD_STAGES.READING_GOOGLE_METADATA_FILES ||
uploadStage === UPLOAD_STAGES.EXTRACTING_METADATA ||
uploadStage === UPLOAD_STAGES.UPLOADING) && (
<>
<LinearProgress
sx={{
height: '2px',
@ -16,8 +17,9 @@ export function UploadProgressBar({ uploadStage, now, expanded }) {
variant="determinate"
value={now}
/>
)}
<Divider />
</>
)}
</Box>
);
}