Fixed Bar component

Moved width prop from direct prop to sx prop, updated PropTypes to accept string|object.
This commit is contained in:
anton.strover committed 2025-08-29 11:24:57 +01:00
1 parent 0ad759a384
commit fd951bfdd5
1 file changed
+2 -2
@@ -23,10 +23,10 @@ const Bar = ({ width, height, backgroundColor, borderRadius, children }) => {
return ( return (
<Box <Box
position="relative" position="relative"
width={width}
height={height} height={height}
backgroundColor={backgroundColor} backgroundColor={backgroundColor}
sx={{ sx={{
width: width,
borderRadius: borderRadius || theme.spacing(1.5), borderRadius: borderRadius || theme.spacing(1.5),
}} }}
> >
@@ -36,7 +36,7 @@ const Bar = ({ width, height, backgroundColor, borderRadius, children }) => {
}; };
Bar.propTypes = { Bar.propTypes = {
width: PropTypes.string.isRequired, width: PropTypes.oneOfType([PropTypes.string, PropTypes.object]).isRequired,
height: PropTypes.string.isRequired, height: PropTypes.string.isRequired,
backgroundColor: PropTypes.string.isRequired, backgroundColor: PropTypes.string.isRequired,
borderRadius: PropTypes.string, borderRadius: PropTypes.string,