Skip to content

Commit

Permalink
Merge pull request #1457 from bluewave-labs/fix/response-chart-color
Browse files Browse the repository at this point in the history
fix: pie chart colors and Metrics box that was overflowing
  • Loading branch information
ajhollid authored Dec 23, 2024
2 parents 0221e5b + 49f675c commit 85a73fd
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 18 deletions.
26 changes: 13 additions & 13 deletions Client/src/Pages/PageSpeed/Details/Charts/PieChart.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,21 +101,21 @@ PieValueLabel.propTypes = {
highlighted: PropTypes.bool.isRequired,
};

/**
* Weight constants for different performance metrics.
* @type {Object}
*/
const weights = {
fcp: 10,
si: 10,
lcp: 25,
tbt: 30,
cls: 25,
};

const PieChart = ({ audits }) => {
const theme = useTheme();

/**
* Weight constants for different performance metrics.
* @type {Object}
*/
const weights = {
fcp: 10,
si: 10,
lcp: 25,
tbt: 30,
cls: 25,
};

/**
* Retrieves color properties based on the performance value.
*
Expand All @@ -128,7 +128,7 @@ const PieChart = ({ audits }) => {
stroke: theme.palette.success.main,
strokeBg: theme.palette.success.light,
text: theme.palette.success.contrastText,
bg: theme.palette.success.dark,
bg: theme.palette.success.light,
};
else if (value >= 50 && value < 90)
return {
Expand Down
1 change: 1 addition & 0 deletions Client/src/Pages/PageSpeed/Details/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ const PageSpeedDetails = () => {
</Box>
<ChartBox
flex={1}
/* TODO apply 1fr 1fr for columns, and auto 1fr for Rows */
sx={{ gridTemplateColumns: "50% 50%", gridTemplateRows: "15% 85%" }}
>
<Stack
Expand Down
2 changes: 1 addition & 1 deletion Client/src/Pages/PageSpeed/Details/styled.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Stack, styled } from "@mui/material";

export const ChartBox = styled(Stack)(({ theme }) => ({
display: "grid",
height: 300,
minHeight: 300,
minWidth: 250,
border: 1,
borderStyle: "solid",
Expand Down
2 changes: 0 additions & 2 deletions Client/src/Pages/Settings/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import timezones from "../../Utils/timezones.json";
import { useState, useEffect } from "react";
import { networkService } from "../../main";
import { settingsValidation } from "../../Validation/validation";
import { useNavigate } from "react-router";
import Dialog from "../../Components/Dialog";
import { useIsAdmin } from "../../Hooks/useIsAdmin";
import ConfigBox from "../../Components/ConfigBox";
Expand All @@ -44,7 +43,6 @@ const Settings = () => {
const deleteStatsMonitorsInitState = { deleteMonitors: false, deleteStats: false };
const [isOpen, setIsOpen] = useState(deleteStatsMonitorsInitState);
const dispatch = useDispatch();
const navigate = useNavigate();

//Fetching latest release version from github
useEffect(() => {
Expand Down
5 changes: 3 additions & 2 deletions Client/src/Utils/Theme/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ const paletteColors = {
green50: "#D4F4E1",
green150: "#45BB7A",
green400: "#079455",
green500: "#07B467",
green800: "#1C4428",
green900: "#12261E",
red50: "#F9ECED",
Expand Down Expand Up @@ -96,10 +97,10 @@ const semanticColors = {
},
contrastText: {
light: paletteColors.green50,
dark: paletteColors.green900,
dark: paletteColors.green50,
},
light: {
light: paletteColors.green50,
light: paletteColors.green500,
dark: paletteColors.green800,
},
dark: {
Expand Down

0 comments on commit 85a73fd

Please sign in to comment.