Skip to content

Commit

Permalink
Revert unnecessary change
Browse files Browse the repository at this point in the history
  • Loading branch information
jjoyce0510 committed Mar 11, 2021
1 parent d7a7d58 commit 298278f
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions datahub-web-react/src/utils/test-utils/TestPageContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { EntityRegistryContext } from '../../entityRegistryContext';
import { TagEntity } from '../../app/entity/tag/Tag';

import defaultThemeConfig from '../../conf/theme/theme_light.config.json';
import { Theme } from '../../conf/theme/types';

type Props = {
children: React.ReactNode;
Expand All @@ -27,22 +26,8 @@ export function getTestEntityRegistry() {
export default ({ children, initialEntries }: Props) => {
const entityRegistry = useMemo(() => getTestEntityRegistry(), []);

const theme: Theme = useMemo(() => {
const overridesWithoutPrefix: { [key: string]: any } = {};
const themeConfig = defaultThemeConfig;
Object.assign(overridesWithoutPrefix, themeConfig.styles);
Object.keys(overridesWithoutPrefix).forEach((key) => {
overridesWithoutPrefix[key.substring(1)] = overridesWithoutPrefix[key];
delete overridesWithoutPrefix[key];
});
return {
...themeConfig,
styles: overridesWithoutPrefix as Theme['styles'],
};
}, []);

return (
<ThemeProvider theme={theme}>
<ThemeProvider theme={defaultThemeConfig}>
<MemoryRouter initialEntries={initialEntries}>
<EntityRegistryContext.Provider value={entityRegistry}>{children}</EntityRegistryContext.Provider>
</MemoryRouter>
Expand Down

0 comments on commit 298278f

Please sign in to comment.