chore: make pageTheme optional & provide default value

This commit is contained in:
Marvin9
2020-10-15 19:34:57 +05:30
parent 53104074ee
commit 973500dd8d
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -23,6 +23,7 @@ import {
BackstageThemeOptions,
SimpleThemeOptions,
} from './types';
import { pageTheme as defaultPageThemes } from './pageTheme';
const DEFAULT_FONT_FAMILY =
'"Helvetica Neue", Helvetica, Roboto, Arial, sans-serif';
@@ -34,7 +35,7 @@ export function createThemeOptions(
palette,
fontFamily = DEFAULT_FONT_FAMILY,
defaultPageTheme,
pageTheme,
pageTheme = defaultPageThemes,
} = options;
if (!pageTheme[defaultPageTheme]) {
+1 -1
View File
@@ -94,7 +94,7 @@ export interface BackstageThemeOptions extends ThemeOptions {
export type SimpleThemeOptions = {
palette: BackstagePaletteOptions;
defaultPageTheme: string;
pageTheme: Record<string, PageTheme>;
pageTheme?: Record<string, PageTheme>;
fontFamily?: string;
};