make Provider required in AppTheme
Signed-off-by: Colton Padden <colton.padden@fastmail.com>
This commit is contained in:
@@ -87,9 +87,6 @@ export function AppThemeProvider({ children }: PropsWithChildren<{}>) {
|
||||
if (!appTheme) {
|
||||
throw new Error('App has no themes');
|
||||
}
|
||||
if (!appTheme.Provider) {
|
||||
throw new Error('App has no theme provider');
|
||||
}
|
||||
|
||||
return <appTheme.Provider children={children} />;
|
||||
}
|
||||
|
||||
@@ -164,7 +164,7 @@ export type AppTheme = {
|
||||
title: string;
|
||||
variant: 'light' | 'dark';
|
||||
icon?: React.ReactElement;
|
||||
Provider?(props: { children: ReactNode }): JSX.Element | null;
|
||||
Provider(props: { children: ReactNode }): JSX.Element | null;
|
||||
};
|
||||
|
||||
// @public
|
||||
|
||||
@@ -44,7 +44,7 @@ export type AppTheme = {
|
||||
*/
|
||||
icon?: React.ReactElement;
|
||||
|
||||
Provider?(props: { children: ReactNode }): JSX.Element | null;
|
||||
Provider(props: { children: ReactNode }): JSX.Element | null;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -40,11 +40,13 @@ describe('SidebarThemeSwitcher', () => {
|
||||
id: 'dark',
|
||||
title: 'Dark Theme',
|
||||
variant: 'dark',
|
||||
Provider: jest.fn(),
|
||||
},
|
||||
{
|
||||
id: 'light',
|
||||
title: 'Light Theme',
|
||||
variant: 'light',
|
||||
Provider: jest.fn(),
|
||||
},
|
||||
]);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user