mirror of
https://github.com/Unleash/unleash.git
synced 2024-11-01 19:07:38 +01:00
b496990f79
Adds a Biome rule for "no unused imports", which is something we sometimes have trouble catching. We're adding this as a warning for now. It is safely and easily fixable with `yarn lint:fix`. ![image](https://github.com/Unleash/unleash/assets/14320932/fd84dea8-6b20-4ba5-bfd8-047b9dcf2bff) ![image](https://github.com/Unleash/unleash/assets/14320932/990bb0b0-760a-4c5e-8136-d957e902bf0b)
25 lines
662 B
TypeScript
25 lines
662 B
TypeScript
import { FC } from 'react';
|
|
import { CssBaseline, ThemeProvider as MuiThemeProvider } from '@mui/material';
|
|
|
|
import createCache from '@emotion/cache';
|
|
import { CacheProvider } from '@emotion/react';
|
|
import { useThemeMode } from 'hooks/useThemeMode';
|
|
|
|
export const muiCache = createCache({
|
|
key: 'mui',
|
|
prepend: true,
|
|
});
|
|
|
|
export const ThemeProvider: FC = ({ children }) => {
|
|
const { resolveTheme } = useThemeMode();
|
|
|
|
return (
|
|
<CacheProvider value={muiCache}>
|
|
<MuiThemeProvider theme={resolveTheme()}>
|
|
<CssBaseline />
|
|
{children}
|
|
</MuiThemeProvider>
|
|
</CacheProvider>
|
|
);
|
|
};
|