Added bars transition

This commit is contained in:
Daniel Cojocea committed 2024-08-23 14:34:26 -04:00
1 parent 931d15c451
commit 8778fa888f
2 files changed
+11 -4

No files matched your search

@@ -1,10 +1,16 @@
import { useTheme } from "@emotion/react";
import { Box, Stack, Tooltip, Typography } from "@mui/material";
import { formatDate } from "../../../Utils/timeUtils";
import { useEffect, useState } from "react";
import "./index.css";
const BarChart = ({ checks = [] }) => {
const theme = useTheme();
const [animate, setAnimate] = useState(false);
useEffect(() => {
setAnimate(true);
});
// set responseTime to average if there's only one check
if (checks.length === 1) {
@@ -106,15 +112,15 @@ const BarChart = ({ checks = [] }) => {
sx={{
borderRadius: "3px",
"&:hover > .MuiBox-root": {
filter: "brightness(0.8)",
},
filter: "brightness(0.8)",
},
}}
>
<Box
position="absolute"
bottom={0}
width="100%"
height={`${check.responseTime}%`}
height={`${animate ? check.responseTime : 0}%`}
backgroundColor={
check.status
? theme.label.up.dotColor
@@ -122,6 +128,7 @@ const BarChart = ({ checks = [] }) => {
}
sx={{
borderRadius: "3px",
transition: "height 600ms cubic-bezier(0.4, 0, 0.2, 1)",
}}
/>
</Box>
+1 -1
View File
@@ -427,7 +427,7 @@ function Sidebar() {
onClick={() =>
item.path === "support"
? window.open(
"https://github.com/bluewave-labs/bluewave-uptime",
"https://github.com/bluewave-labs/bluewave-uptime/issues",
"_blank",
"noreferrer"
)