File tree Expand file tree Collapse file tree 3 files changed +27
-23
lines changed Expand file tree Collapse file tree 3 files changed +27
-23
lines changed Original file line number Diff line number Diff line change 1
- import { PaletteColorOptions } from "@mui/material" ;
1
+ import { PaletteColor } from "@mui/material" ;
2
2
3
3
/**
4
4
* Palette "Hero"
@@ -17,7 +17,9 @@ export const heroMain = HERO.MAIN;
17
17
/**
18
18
* Palette Option "Hero"
19
19
*/
20
- export const hero : PaletteColorOptions = {
20
+ export const hero : PaletteColor = {
21
+ contrastText : "#FFFFFF" ,
22
+ dark : heroMain ,
21
23
light : heroLight ,
22
24
main : heroMain ,
23
25
} ;
Original file line number Diff line number Diff line change @@ -9,15 +9,16 @@ import * as P from "./common/palette";
9
9
* @returns theme with custom theme overrides.
10
10
*/
11
11
export function mergeAppTheme ( theme : Theme ) : Theme {
12
- return createTheme (
13
- deepmerge ( theme , {
14
- components : {
15
- MuiButton : C . MuiButton ( theme ) ,
16
- MuiCssBaseline : C . MuiCssBaseline ( theme ) ,
17
- } ,
18
- palette : {
19
- hero : P . hero ,
20
- } ,
21
- } )
22
- ) ;
12
+ const appTheme = { ...theme } ;
13
+
14
+ // Merge palette with hero color.
15
+ appTheme . palette = { ...appTheme . palette , hero : P . hero } ;
16
+
17
+ // Marge custom components.
18
+ const components = {
19
+ MuiButton : C . MuiButton ( appTheme ) ,
20
+ MuiCssBaseline : C . MuiCssBaseline ( appTheme ) ,
21
+ } ;
22
+
23
+ return createTheme ( deepmerge ( appTheme , components ) ) ;
23
24
}
Original file line number Diff line number Diff line change 1
- import { Theme as MTheme } from "@mui/material" ;
2
-
3
- /**
4
- * Button prop options.
5
- */
6
- declare module "@mui/material/Button" {
7
- interface ButtonPropsColorOverrides {
8
- hero : true ;
9
- }
10
- }
1
+ import type { } from "@mui/material/Button" ;
2
+ import { PaletteColorOptions } from "@mui/material/styles" ;
11
3
12
4
/**
13
5
* Palette definitions.
@@ -22,6 +14,15 @@ declare module "@mui/material/styles/createPalette" {
22
14
}
23
15
}
24
16
17
+ /**
18
+ * Button prop options.
19
+ */
20
+ declare module "@mui/material/Button" {
21
+ interface ButtonPropsColorOverrides {
22
+ hero : true ;
23
+ }
24
+ }
25
+
25
26
declare module "@emotion/react" {
26
27
export interface Theme extends MTheme {
27
28
name : "EmotionTheme" ;
You can’t perform that action at this time.
0 commit comments