Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a new HOC in status bar in order to make sure it works on both … #1845

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 21 additions & 14 deletions src/Components/Charts/StatusPageBarChart/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,21 @@ const StatusPageBarChart = ({ checks = [] }) => {
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 (
<Stack
direction="row"
Expand All @@ -41,15 +56,11 @@ const StatusPageBarChart = ({ checks = [] }) => {
/* 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
// even if there are less than 25 checks
<Box
<BarBox
key={`${check}-${index}`}
position="relative"
width="calc(30vw / 25)"
width="calc(30rem / 25)"
height="100%"
backgroundColor={theme.palette.primary.lowContrast}
sx={{
borderRadius: theme.spacing(1.5),
}}
/>
) : (
<Tooltip
Expand Down Expand Up @@ -140,14 +151,10 @@ const StatusPageBarChart = ({ checks = [] }) => {
},
}}
>
<Box
position="relative"
width="calc(30vw / 25)"
<BarBox
width="calc(30rem / 25)"
height="100%"
backgroundColor={theme.palette.primary.lowContrast} // CAIO_REVIEW
sx={{
borderRadius: theme.spacing(1.5),
}}
backgroundColor={theme.palette.primary.lowContrast}
>
<Box
position="absolute"
Expand All @@ -164,7 +171,7 @@ const StatusPageBarChart = ({ checks = [] }) => {
transition: "height 600ms cubic-bezier(0.4, 0, 0.2, 1)",
}}
/>
</Box>
</BarBox>
</Tooltip>
)
)}
Expand Down