Skip to content

Commit

Permalink
Merge pull request #5429 from marmelab/theme-type
Browse files Browse the repository at this point in the history
Add type for theme
  • Loading branch information
fzaninotto committed Oct 22, 2020
2 parents 9442fcf + f245c85 commit 235c42f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
17 changes: 17 additions & 0 deletions packages/ra-ui-materialui/src/defaultTheme.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import { ThemeOptions } from '@material-ui/core';
import { Overrides } from '@material-ui/core/styles/overrides';

export default {
palette: {
secondary: {
Expand Down Expand Up @@ -27,3 +30,17 @@ export default {
},
},
};

// Temporary solution until we specify our components in it like MUI does
// See https://github.com/mui-org/material-ui/blob/master/packages/material-ui/src/styles/overrides.d.ts#L103
export interface RaThemeOverrides extends Overrides {
[key: string]: any;
}

export interface RaThemeOptions extends ThemeOptions {
sidebar: {
width: number;
closedWidth: number;
};
overrides: RaThemeOverrides;
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Link from './Link';
import defaultTheme from './defaultTheme';
import defaultTheme, { RaThemeOptions, RaThemeOverrides } from './defaultTheme';

export * from './auth';
export * from './button';
Expand All @@ -10,5 +10,6 @@ export * from './input';
export * from './layout';
export * from './list';
export { Link, defaultTheme };
export type { RaThemeOptions, RaThemeOverrides };

export * from './types';

0 comments on commit 235c42f

Please sign in to comment.