Added a new HOC in status bar in order to make sure it works on both the resolution, high and low.

This commit is contained in:
Owaise Imdad committed 2025-03-01 08:10:16 +05:30
1 parent 1cadb2c45f
commit 947f5ff773
1 file changed
+21 -14
@@ -24,6 +24,21 @@ const StatusPageBarChart = ({ checks = [] }) => {
checks = [...checks, ...placeholders]; checks = [...checks, ...placeholders];
} }
const BarBox = ({ width, height, backgroundColor, borderRadius, children }) => (
<Box
marginRight="5px"
position="relative"
width={width}
height={height}
backgroundColor={backgroundColor}
sx={{
borderRadius: borderRadius || theme.spacing(1.5),
}}
>
{children}
</Box>
);
return ( return (
<Stack <Stack
direction="row" direction="row"
@@ -41,15 +56,11 @@ const StatusPageBarChart = ({ checks = [] }) => {
/* TODO what is the purpose of this box? */ /* TODO what is the purpose of this box? */
// CAIO_REVIEW the purpose of this box is to make sure there are always at least 25 bars // CAIO_REVIEW the purpose of this box is to make sure there are always at least 25 bars
// even if there are less than 25 checks // even if there are less than 25 checks
<Box <BarBox
key={`${check}-${index}`} key={`${check}-${index}`}
position="relative" width="calc(30rem / 25)"
width="calc(30vw / 25)"
height="100%" height="100%"
backgroundColor={theme.palette.primary.lowContrast} backgroundColor={theme.palette.primary.lowContrast}
sx={{
borderRadius: theme.spacing(1.5),
}}
/> />
) : ( ) : (
<Tooltip <Tooltip
@@ -140,14 +151,10 @@ const StatusPageBarChart = ({ checks = [] }) => {
}, },
}} }}
> >
<Box <BarBox
position="relative" width="calc(30rem / 25)"
width="calc(30vw / 25)"
height="100%" height="100%"
backgroundColor={theme.palette.primary.lowContrast} // CAIO_REVIEW backgroundColor={theme.palette.primary.lowContrast}
sx={{
borderRadius: theme.spacing(1.5),
}}
> >
<Box <Box
position="absolute" position="absolute"
@@ -164,7 +171,7 @@ const StatusPageBarChart = ({ checks = [] }) => {
transition: "height 600ms cubic-bezier(0.4, 0, 0.2, 1)", transition: "height 600ms cubic-bezier(0.4, 0, 0.2, 1)",
}} }}
/> />
</Box> </BarBox>
</Tooltip> </Tooltip>
) )
)} )}