Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/colors general #1556

Merged
merged 49 commits into from
Jan 21, 2025
Merged
Show file tree
Hide file tree
Changes from 48 commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
db86753
feat: updating texts
marcelluscaio Jan 8, 2025
3ffcadc
feat: setting new colors
marcelluscaio Jan 9, 2025
7686b1e
fix: breadcrumbs
marcelluscaio Jan 9, 2025
07641a2
feat: fixing table
marcelluscaio Jan 9, 2025
be144c5
feat: search and actions
marcelluscaio Jan 9, 2025
3787f9c
feat: fix success grdient
marcelluscaio Jan 9, 2025
dbd351b
fix many
marcelluscaio Jan 11, 2025
d027407
fix percentage uptimePoor
marcelluscaio Jan 11, 2025
8cf28fe
fix: label background color
marcelluscaio Jan 11, 2025
78340ce
fix: logo
marcelluscaio Jan 11, 2025
059927c
feat: changing green for light mode
marcelluscaio Jan 11, 2025
b0aa5e6
feat: changing green for dark mode
marcelluscaio Jan 11, 2025
6bb38c9
feat: extract function
marcelluscaio Jan 11, 2025
c0df164
feat: changing background accent for tertiary main
marcelluscaio Jan 11, 2025
3b1657c
feat: changing background main for primary main
marcelluscaio Jan 11, 2025
74c598e
feat: changed a whole bunch of colors
marcelluscaio Jan 11, 2025
5fcc87d
feat: all colors inside of sideBar
marcelluscaio Jan 11, 2025
46af783
feat: colors for sidebar
marcelluscaio Jan 12, 2025
9fb6db6
feat: excluding selected path from hover changes
marcelluscaio Jan 12, 2025
5eca39c
feat: set accent color buttons hover colors
marcelluscaio Jan 12, 2025
61aaa84
feat: simplify and adjust status label
marcelluscaio Jan 12, 2025
541a5b3
feat: fixing lots of colors
marcelluscaio Jan 12, 2025
e235279
feat: fix incident table
marcelluscaio Jan 12, 2025
a6eb970
feat: finishing adjusting colors
marcelluscaio Jan 12, 2025
2ab6a57
merging
marcelluscaio Jan 12, 2025
921fb6e
spotted errors nd marked to be solved after merge
marcelluscaio Jan 14, 2025
5e9629e
fix: primary buttons
marcelluscaio Jan 14, 2025
d54272b
cleaning unused code
marcelluscaio Jan 14, 2025
6cdac32
feat: some colors fixed, table alignment
marcelluscaio Jan 14, 2025
8fe200f
feat: finished
marcelluscaio Jan 15, 2025
d09382b
fix: toast
marcelluscaio Jan 15, 2025
b4ba9ef
fix: table header color
marcelluscaio Jan 15, 2025
59f60d2
fix inputs
marcelluscaio Jan 15, 2025
53fcd5a
fix: pagespeed details
marcelluscaio Jan 15, 2025
851ad48
feat: Profile Panel buttons
marcelluscaio Jan 15, 2025
8661e83
removing fixed height from css
marcelluscaio Jan 15, 2025
7d76aee
feat: tabs
marcelluscaio Jan 15, 2025
6864756
feat: fix select
marcelluscaio Jan 16, 2025
8404cee
refactor: change all selects instead of relying on sx
marcelluscaio Jan 16, 2025
ec94458
fix: Name on team table
marcelluscaio Jan 16, 2025
bc9d8f0
feat: fix INfrastructure counter
marcelluscaio Jan 16, 2025
8048dae
color fixes
ajhollid Jan 20, 2025
f68e885
status box fix
ajhollid Jan 21, 2025
8021786
fix gauge colors
ajhollid Jan 21, 2025
2070e24
Fix gauge colors
ajhollid Jan 21, 2025
239164e
Fixed invisible text on login page
ajhollid Jan 21, 2025
6eedaa5
various infra details page color fixes
ajhollid Jan 21, 2025
d92a477
Add darker color to accent
ajhollid Jan 21, 2025
f8b3847
Remove console log
ajhollid Jan 21, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Client/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ function App() {
return {
body: {
backgroundImage: `radial-gradient(circle, ${palette.gradient.color1}, ${palette.gradient.color2}, ${palette.gradient.color3}, ${palette.gradient.color4}, ${palette.gradient.color5})`,
color: palette.primary.contrastText,
},
};
}}
Expand Down
9 changes: 6 additions & 3 deletions Client/src/Components/Alert/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,12 @@ const icons = {
const Alert = ({ variant, title, body, isToast, hasIcon = true, onClick }) => {
const theme = useTheme();
/* TODO
This needs fixing. text bg and border not necessarilly exist. Probably text becomes contrastText. border becomes contrastText. bg becomes dark.
Check possible variants, see implementation in light and dark theme, and adjust */
const { text, bg, border } = theme.palette[variant];
Do we need other variants for alert?
*/

const text = theme.palette.secondary.contrastText;
const bg = theme.palette.secondary.main;
const border = theme.palette.secondary.contrastText;
Comment on lines +38 to +40
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Hold up, why we locked into secondary colors? 🤔

Using fixed secondary palette colors limits the component's flexibility. Consider:

  1. Map colors based on variant
  2. Allow color customization through props
- const text = theme.palette.secondary.contrastText;
- const bg = theme.palette.secondary.main;
- const border = theme.palette.secondary.contrastText;
+ const getAlertColors = (theme, variant) => ({
+   text: theme.palette[variant]?.contrastText ?? theme.palette.secondary.contrastText,
+   bg: theme.palette[variant]?.main ?? theme.palette.secondary.main,
+   border: theme.palette[variant]?.contrastText ?? theme.palette.secondary.contrastText,
+ });

Committable suggestion skipped: line range outside the PR's diff.

const icon = icons[variant];

return (
Expand Down
10 changes: 8 additions & 2 deletions Client/src/Components/Animated/PulseDot.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import PropTypes from "prop-types";
import { Box, Stack } from "@mui/material";
import { Box, Stack, useTheme } from "@mui/material";
// import useUtils from "../../Pages/Uptime/utils";

/**
* A component that renders a pulsating dot with a specified color.
Expand All @@ -15,6 +16,11 @@ import { Box, Stack } from "@mui/material";
*/

const PulseDot = ({ color }) => {
const theme = useTheme();
// const { statusToTheme } = useUtils();
/* TODO refactor so it gets status and gets theme color. Then uses theme.palette.[themeColor].lowContrast */
/* const themeColor = statusToTheme[status]; */

return (
<Stack
width="26px"
Expand Down Expand Up @@ -44,7 +50,7 @@ const PulseDot = ({ color }) => {
width: "7px",
height: "7px",
borderRadius: "50%",
backgroundColor: "white",
backgroundColor: theme.palette.accent.contrastText,
top: "50%",
left: "50%",
transform: "translate(-50%, -50%)",
Expand Down
9 changes: 6 additions & 3 deletions Client/src/Components/Avatar/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,16 @@ const Avatar = ({ src, small, sx }) => {
return (
<MuiAvatar
alt={`${user?.firstName} ${user?.lastName}`}
/* TODO What is the /static/images/avatar/2.jpg ?*/
src={src ? src : user?.avatarImage ? image : "/static/images/avatar/2.jpg"}
sx={{
Comment on lines +35 to 37
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

Yo dawg, that fallback image is MIA! 🍝

The static image path /static/images/avatar/2.jpg is used as a fallback in multiple components, but I couldn't find the actual image file. This could cause broken image placeholders if the main avatar sources fail.

  • Consider making this fallback path configurable through environment variables or a config file
  • Ensure the fallback image actually exists in your production environment
  • You might want to use a base64 encoded default avatar to avoid external file dependencies
🔗 Analysis chain

Yo, what's the deal with this static image path? 🤔

That TODO comment's spittin' facts - we need to understand what /static/images/avatar/2.jpg is about. Should this be configurable?

Let's check if this image actually exists:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for references to static avatar images
rg -l "/static/images/avatar"

Length of output: 125


Script:

#!/bin/bash
# Check the implementation in ProfilePanel.jsx
rg -A 5 -B 5 "/static/images/avatar" Client/src/Components/TabPanels/Account/ProfilePanel.jsx

# Look for potential config files
fd -e js -e json -e jsx config

Length of output: 404


Script:

#!/bin/bash
# Check vite configuration
cat Client/vite.config.js

# Also check if the image exists in the static directory
fd -g "*.jpg" -g "*.png" static

Length of output: 495

fontSize: small ? "16px" : "22px",
color: "white",
fontWeight: 400,
backgroundColor: theme.palette.primary.main, // Same BG color as checkmate BG in sidebar
color: theme.palette.accent.contrastText,
backgroundColor: theme.palette.accent.main, // Same BG color as checkmate BG in sidebar
display: "inline-flex",
/*
TODO not sure what this is for*/
"&::before": {
content: `""`,
position: "absolute",
Expand All @@ -54,7 +57,7 @@ const Avatar = ({ src, small, sx }) => {
}}
>
{user.firstName?.charAt(0)}
{user.lastName?.charAt(0) || ''}
{user.lastName?.charAt(0) || ""}
</MuiAvatar>
);
};
Expand Down
Loading
Loading