mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-17 15:06:02 +01:00
refactor(web/progress): hide progress bar if not visible
This commit is contained in:
@@ -66,18 +66,20 @@ const Progressbar: React.FC = () => {
|
||||
|
||||
return (
|
||||
<>
|
||||
<Box className={classes.container}>
|
||||
<Box
|
||||
className={classes.bar}
|
||||
onAnimationEnd={progressComplete}
|
||||
sx={{
|
||||
width: '0%',
|
||||
animation: 'progress-bar linear',
|
||||
animationDuration: `${duration}ms`,
|
||||
}}
|
||||
/>
|
||||
<Text className={classes.label}>{label}</Text>
|
||||
</Box>
|
||||
{visible && (
|
||||
<Box className={classes.container}>
|
||||
<Box
|
||||
className={classes.bar}
|
||||
onAnimationEnd={progressComplete}
|
||||
sx={{
|
||||
width: '0%',
|
||||
animation: 'progress-bar linear',
|
||||
animationDuration: `${duration}ms`,
|
||||
}}
|
||||
/>
|
||||
<Text className={classes.label}>{label}</Text>
|
||||
</Box>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user