mirror of
https://github.com/bluewave-labs/Checkmate.git
synced 2026-01-20 00:29:45 -06:00
fix undefined colors, removed log statements
This commit is contained in:
@@ -23,7 +23,7 @@ const handleStatusCode = (status) => {
|
||||
};
|
||||
|
||||
const getRoundedStatusCode = (status) => {
|
||||
return Math.floor(status / 100) * 100;
|
||||
return Math.floor(status / 100) * 100;
|
||||
};
|
||||
|
||||
const HttpStatusLabel = ({ status, customStyles }) => {
|
||||
@@ -31,12 +31,12 @@ const HttpStatusLabel = ({ status, customStyles }) => {
|
||||
const colors = {
|
||||
400: {
|
||||
dotColor: theme.palette.warning.main,
|
||||
bgColor: theme.palette.warning.bg,
|
||||
bgColor: theme.palette.warning.dark,
|
||||
borderColor: theme.palette.warning.light,
|
||||
},
|
||||
500: {
|
||||
dotColor: theme.palette.error.main,
|
||||
bgColor: theme.palette.error.bg,
|
||||
bgColor: theme.palette.error.dark,
|
||||
borderColor: theme.palette.error.light,
|
||||
},
|
||||
default: {
|
||||
@@ -46,11 +46,10 @@ const HttpStatusLabel = ({ status, customStyles }) => {
|
||||
},
|
||||
};
|
||||
|
||||
const statusCode = handleStatusCode(status)
|
||||
const statusCode = handleStatusCode(status);
|
||||
|
||||
const { borderColor, bgColor, dotColor } =
|
||||
colors[getRoundedStatusCode(statusCode)] || colors.default;
|
||||
|
||||
return (
|
||||
<BaseLabel
|
||||
label={String(statusCode)}
|
||||
@@ -65,7 +64,7 @@ const HttpStatusLabel = ({ status, customStyles }) => {
|
||||
};
|
||||
|
||||
HttpStatusLabel.propTypes = {
|
||||
status:PropTypes.number,
|
||||
status: PropTypes.number,
|
||||
customStyles: PropTypes.object,
|
||||
};
|
||||
|
||||
|
||||
@@ -20,8 +20,6 @@ const Monitors = ({ isAdmin }) => {
|
||||
const authState = useSelector((state) => state.auth);
|
||||
const dispatch = useDispatch({});
|
||||
|
||||
console.log({ monitorState });
|
||||
|
||||
useEffect(() => {
|
||||
dispatch(getUptimeMonitorsByTeamId(authState.authToken));
|
||||
}, [authState.authToken, dispatch]);
|
||||
|
||||
Reference in New Issue
Block a user