Skip to content

Commit

Permalink
Use the correct styling method to define theme for a commons-ui compo…
Browse files Browse the repository at this point in the history
…nent

Signed-off-by: BOUTIER Charly <charly.boutier@rte-france.com>
  • Loading branch information
BOUTIER Charly committed Jan 23, 2024
1 parent 19db011 commit f4f0ffc
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions src/components/app-wrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,21 @@ let lightTheme = createTheme({
},
});

lightTheme = createTheme(lightTheme, {
palette: {
cancelButtonColor: {
main: lightTheme.palette.text.secondary,
},
},
components: {
CancelButton: {
defaultProps: {
color: 'cancelButtonColor',
},
},
},
});

let darkTheme = createTheme({
palette: {
mode: 'dark',
Expand Down Expand Up @@ -124,6 +139,21 @@ let darkTheme = createTheme({
},
});

darkTheme = createTheme(darkTheme, {
palette: {
cancelButtonColor: {
main: darkTheme.palette.text.secondary,
},
},
components: {
CancelButton: {
defaultProps: {
color: 'cancelButtonColor',
},
},
},
});

const getMuiTheme = (theme) => {
if (theme === LIGHT_THEME) {
return lightTheme;
Expand Down

0 comments on commit f4f0ffc

Please sign in to comment.