flatlogic / react-material-admin

☄️React Material Admin is a React template built with Material-UI
https://flatlogic.com/admin-dashboards/react-material-admin/demo
MIT License
1.6k stars 559 forks source link

Custom Dot color ignored #26

Closed rgiffen closed 3 years ago

rgiffen commented 4 years ago

The Dot component will only show named colors in the palette although I believe the intent is to support rgb values as well. To see the issue, in the Dashboard page, set one of the Dot colors to an rgb value <Dot color="#990000" /> The Dot will appear grey (the default color).

The code in Dot that sets the color tries to set the "most appropriate" value backgroundColor: color && theme.palette[color] && theme.palette[color].main, But if color has a non-null value this will always evaluate the second element and this may return null. Suggest to first check for the theme color and if null then use the color value backgroundColor: (theme.palette[color] && theme.palette[color].main) || color,

michaeldaineka commented 3 years ago

Hi @rgiffen.

Thx for the feedback.

We will work on this.