theme: unify theme additions type
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
committed by
Philipp Hugenroth
parent
91ea8e8343
commit
f728b0f62e
@@ -104,3 +104,13 @@ export type PageTheme = {
|
||||
backgroundImage: string;
|
||||
fontColor: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* Backstage specific additions to the material-ui theme.
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export type BackstageThemeAdditions = {
|
||||
page: PageTheme;
|
||||
getPageTheme: (selector: PageThemeSelector) => PageTheme;
|
||||
};
|
||||
|
||||
@@ -21,6 +21,7 @@ import {
|
||||
} from '@material-ui/core/styles/createPalette';
|
||||
import {
|
||||
BackstagePaletteAdditions,
|
||||
BackstageThemeAdditions,
|
||||
PageTheme,
|
||||
PageThemeSelector,
|
||||
} from '../types';
|
||||
@@ -93,13 +94,7 @@ declare module '@material-ui/core/styles/createPalette' {
|
||||
}
|
||||
|
||||
declare module '@material-ui/core/styles/createTheme' {
|
||||
interface Theme {
|
||||
page: PageTheme;
|
||||
getPageTheme: (selector: PageThemeSelector) => PageTheme;
|
||||
}
|
||||
interface Theme extends BackstageThemeAdditions {}
|
||||
|
||||
interface ThemeOptions {
|
||||
page: PageTheme;
|
||||
getPageTheme: (selector: PageThemeSelector) => PageTheme;
|
||||
}
|
||||
interface ThemeOptions extends BackstageThemeAdditions {}
|
||||
}
|
||||
|
||||
@@ -14,11 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {
|
||||
BackstagePaletteAdditions,
|
||||
PageTheme,
|
||||
PageThemeSelector,
|
||||
} from '../types';
|
||||
import { BackstagePaletteAdditions, BackstageThemeAdditions } from '../types';
|
||||
|
||||
declare module '@mui/material/styles/createPalette' {
|
||||
interface Palette extends BackstagePaletteAdditions {}
|
||||
@@ -27,15 +23,9 @@ declare module '@mui/material/styles/createPalette' {
|
||||
}
|
||||
|
||||
declare module '@mui/material/styles/createTheme' {
|
||||
interface Theme {
|
||||
pageTheme: PageTheme;
|
||||
getPageTheme: (selector: PageThemeSelector) => PageTheme;
|
||||
}
|
||||
interface Theme extends BackstageThemeAdditions {}
|
||||
|
||||
interface ThemeOptions {
|
||||
pageTheme: PageTheme;
|
||||
getPageTheme: (selector: PageThemeSelector) => PageTheme;
|
||||
}
|
||||
interface ThemeOptions extends BackstageThemeAdditions {}
|
||||
}
|
||||
|
||||
// This is a workaround for missing methods in React 17 that MUI v5 depends on
|
||||
|
||||
Reference in New Issue
Block a user