Skip to content

Commit ab524d3

Browse files
committed
delete ThemeContext.ts and move logic to ThemeContext.tsx
1 parent a65293b commit ab524d3

3 files changed

Lines changed: 11 additions & 13 deletions

File tree

clients/ui/frontend/src/app/MUIThemeContext.ts

Lines changed: 0 additions & 11 deletions
This file was deleted.

clients/ui/frontend/src/app/ThemeContext.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,21 @@ import * as React from 'react';
22
import { createTheme } from '@mui/material';
33
import { ThemeProvider as MUIThemeProvider } from '@mui/material/styles';
44
import { isMUITheme, Theme } from '~/shared/utilities/const';
5-
import { ThemeContext } from './MUIThemeContext';
65

76
type ThemeProviderProps = {
87
children: React.ReactNode;
98
};
109

10+
type ThemeContextProps = {
11+
isMUITheme: boolean;
12+
};
13+
14+
export const ThemeContext = React.createContext({
15+
isMUITheme: false,
16+
});
17+
18+
export const useThemeContext = (): ThemeContextProps => React.useContext(ThemeContext);
19+
1120
const ThemeProvider: React.FC<ThemeProviderProps> = ({ children }) => {
1221
const themeValue = React.useMemo(() => ({ isMUITheme: isMUITheme() }), []);
1322
const createMUITheme = React.useMemo(() => createTheme({ cssVariables: true }), []);

clients/ui/frontend/src/app/pages/modelRegistry/ModelRegistryCoreLoader.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { ProjectObjectType, typedEmptyImage } from '~/shared/components/design/u
77
import { ModelRegistryContextProvider } from '~/app/context/ModelRegistryContext';
88
import TitleWithIcon from '~/shared/components/design/TitleWithIcon';
99
import KubeflowDocs from '~/shared/components/KubeflowDocs';
10-
import { useThemeContext } from '~/app/MUIThemeContext';
10+
import { useThemeContext } from '~/app/ThemeContext';
1111
import EmptyModelRegistryState from './screens/components/EmptyModelRegistryState';
1212
import InvalidModelRegistry from './screens/InvalidModelRegistry';
1313
import ModelRegistrySelectorNavigator from './screens/ModelRegistrySelectorNavigator';

0 commit comments

Comments
 (0)