Implement styling to match Figma designs

This commit is contained in:
Daniel Cojocea committed 2024-08-14 15:28:46 -04:00
1 parent fec0081ea5
commit b72fbc4599
4 files changed
+54 -61

No files matched your search

+1 -1
View File
@@ -72,7 +72,7 @@
}
.MuiPaper-root + .MuiPagination-root {
margin-top: 35px;
margin-top: 24px;
border: solid 1px var(--env-var-color-16);
border-radius: var(--env-var-radius-1);
padding: var(--env-var-spacing-1-plus) var(--env-var-spacing-2);
@@ -1,13 +1,4 @@
import {
BarChart,
Bar,
XAxis,
YAxis,
Cell,
ResponsiveContainer,
ReferenceLine,
Label,
} from "recharts";
import { BarChart, Bar, Cell, ReferenceLine, Label } from "recharts";
import PropTypes from "prop-types";
@@ -23,34 +14,32 @@ const MonitorDetails60MinChart = ({ data }) => {
undefined: "var(--env-var-color-33)",
};
return (
<ResponsiveContainer width="100%" height={35}>
<BarChart
height={20}
data={data}
margin={{ top: 15, left: 15, right: 15, bottom: 0 }}
<BarChart
width={data.length * 10 + 30}
height={35}
data={data}
margin={{ top: 14, left: 15, right: 15, bottom: 2 }}
style={{ alignSelf: "baseline" }}
>
<Bar dataKey="value" barSize={10}>
{data.map((check, index) => (
<Cell key={`cell-${index}`} fill={color[check.status]} />
))}
</Bar>
<ReferenceLine x={0} stroke="black" strokeDasharray="3 3">
<Label value="60 mins" position="top" style={labelStyle} />
</ReferenceLine>
<ReferenceLine
x={Math.floor(data.length * (2 / 3))}
stroke="black"
strokeDasharray="3 3"
>
<XAxis hide={true} />
<YAxis hide={true} domain={[0, 100]} />
<Bar dataKey="value" barSize={15}>
{data.map((check, index) => (
<Cell key={`cell-${index}`} fill={color[check.status]} />
))}
</Bar>
<ReferenceLine x={0} stroke="black" strokeDasharray="3 3">
<Label value="60 mins" position="top" style={labelStyle} />
</ReferenceLine>
<ReferenceLine
x={Math.floor(data.length * (2 / 3))}
stroke="black"
strokeDasharray="3 3"
>
<Label value="20 mins" position="top" style={labelStyle} />
</ReferenceLine>
<ReferenceLine x={data.length - 1} stroke="black" strokeDasharray="3 3">
<Label value="Now" position="top" style={labelStyle} />
</ReferenceLine>
</BarChart>
</ResponsiveContainer>
<Label value="20 mins" position="top" style={labelStyle} />
</ReferenceLine>
<ReferenceLine x={data.length - 1} stroke="black" strokeDasharray="3 3">
<Label value="now" position="top" style={labelStyle} />
</ReferenceLine>
</BarChart>
);
};