Added a constant and utilised a responsive-values in MUI.
This commit is contained in:
1 parent
f3537131ef
commit
c5326e5d6a
1 file changed
+7
-2
@@ -49,6 +49,11 @@ const StatusPageBarChart = ({ checks = [] }) => {
|
|||||||
const [animate, setAnimate] = useState(false);
|
const [animate, setAnimate] = useState(false);
|
||||||
const uiTimezone = useSelector((state) => state.ui.timezone);
|
const uiTimezone = useSelector((state) => state.ui.timezone);
|
||||||
|
|
||||||
|
const barWidth = {
|
||||||
|
xs: "calc(60% / 25)",
|
||||||
|
xl: "calc(40% / 25)",
|
||||||
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setAnimate(true);
|
setAnimate(true);
|
||||||
}, []);
|
}, []);
|
||||||
@@ -82,7 +87,7 @@ const StatusPageBarChart = ({ checks = [] }) => {
|
|||||||
// even if there are less than 25 checks
|
// even if there are less than 25 checks
|
||||||
<Bar
|
<Bar
|
||||||
key={`${check}-${index}`}
|
key={`${check}-${index}`}
|
||||||
width="calc(60% / 25)"
|
width={barWidth}
|
||||||
height="100%"
|
height="100%"
|
||||||
backgroundColor={theme.palette.primary.lowContrast}
|
backgroundColor={theme.palette.primary.lowContrast}
|
||||||
/>
|
/>
|
||||||
@@ -176,7 +181,7 @@ const StatusPageBarChart = ({ checks = [] }) => {
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Bar
|
<Bar
|
||||||
width="calc(60% / 25)"
|
width={barWidth}
|
||||||
height="100%"
|
height="100%"
|
||||||
backgroundColor={theme.palette.primary.lowContrast}
|
backgroundColor={theme.palette.primary.lowContrast}
|
||||||
>
|
>
|
||||||
|
|||||||
Reference in new issue
Block a user