refactor(web/progress): hide progress bar if not visible

This commit is contained in:
Luke
2022-12-21 15:00:22 +01:00
parent 102d58cbb1
commit f8f81db3eb

View File

@@ -66,18 +66,20 @@ const Progressbar: React.FC = () => {
return ( return (
<> <>
<Box className={classes.container}> {visible && (
<Box <Box className={classes.container}>
className={classes.bar} <Box
onAnimationEnd={progressComplete} className={classes.bar}
sx={{ onAnimationEnd={progressComplete}
width: '0%', sx={{
animation: 'progress-bar linear', width: '0%',
animationDuration: `${duration}ms`, animation: 'progress-bar linear',
}} animationDuration: `${duration}ms`,
/> }}
<Text className={classes.label}>{label}</Text> />
</Box> <Text className={classes.label}>{label}</Text>
</Box>
)}
</> </>
); );
}; };