refactor(web/progress): improve progress circle alignment

apparently the circle progress wasn't properly aligned this whole time
This commit is contained in:
Luke
2023-01-17 22:12:47 +01:00
parent b3c84d94c4
commit e298b13607

View File

@@ -48,6 +48,10 @@ const useStyles = createStyles((theme, params: { position: 'middle' | 'bottom';
textAlign: 'center', textAlign: 'center',
textShadow: theme.shadows.sm, textShadow: theme.shadows.sm,
color: theme.colors.gray[3], color: theme.colors.gray[3],
height: 25,
},
wrapper: {
marginTop: params.position === 'middle' ? 25 : undefined,
}, },
})); }));
@@ -93,15 +97,17 @@ const CircleProgressbar: React.FC = () => {
<> <>
<Stack spacing={0} className={classes.container}> <Stack spacing={0} className={classes.container}>
<ScaleFade visible={visible}> <ScaleFade visible={visible}>
<RingProgress <Stack spacing={0} align="center" className={classes.wrapper}>
size={90} <RingProgress
thickness={7} size={90}
sections={[{ value: 0, color: theme.primaryColor }]} thickness={7}
onAnimationEnd={progressComplete} sections={[{ value: 0, color: theme.primaryColor }]}
className={classes.progress} onAnimationEnd={progressComplete}
label={<Text className={classes.value}>{value}%</Text>} className={classes.progress}
/> label={<Text className={classes.value}>{value}%</Text>}
{label && <Text className={classes.label}>{label}</Text>} />
{label && <Text className={classes.label}>{label}</Text>}
</Stack>
</ScaleFade> </ScaleFade>
</Stack> </Stack>
</> </>