fix close button

This commit is contained in:
Abhinav 2022-06-11 15:32:12 +05:30
parent 8b9d27e34b
commit fc0d7bb5d9
2 changed files with 8 additions and 5 deletions

View file

@ -9,6 +9,9 @@ export function UploadProgressFooter() {
UploadProgressContext UploadProgressContext
); );
const handleClose = () => {
onClose(null, null);
};
return ( return (
<DialogActions> <DialogActions>
{uploadStage === UPLOAD_STAGES.FINISH && {uploadStage === UPLOAD_STAGES.FINISH &&
@ -18,10 +21,7 @@ export function UploadProgressFooter() {
{constants.RETRY_FAILED} {constants.RETRY_FAILED}
</Button> </Button>
) : ( ) : (
<Button <Button variant="contained" fullWidth onClick={handleClose}>
variant="contained"
fullWidth
onClick={() => onClose.bind(null)}>
{constants.CLOSE} {constants.CLOSE}
</Button> </Button>
))} ))}

View file

@ -51,6 +51,9 @@ export function UploadProgressTitle() {
UploadProgressContext UploadProgressContext
); );
const toggleExpanded = () => setExpanded((expanded) => !expanded); const toggleExpanded = () => setExpanded((expanded) => !expanded);
const handleClose = () => {
onClose(null, null);
};
return ( return (
<DialogTitle> <DialogTitle>
@ -64,7 +67,7 @@ export function UploadProgressTitle() {
<IconButtonWithBG onClick={toggleExpanded}> <IconButtonWithBG onClick={toggleExpanded}>
{expanded ? <MinimizeIcon /> : <MaximizeIcon />} {expanded ? <MinimizeIcon /> : <MaximizeIcon />}
</IconButtonWithBG> </IconButtonWithBG>
<IconButtonWithBG onClick={onClose.bind(null)}> <IconButtonWithBG onClick={handleClose}>
<Close /> <Close />
</IconButtonWithBG> </IconButtonWithBG>
</Stack> </Stack>