mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-21 20:11:43 +08:00
372377dd6b
Co-authored-by: Himself65 <himself65@outlook.com>
30 lines
645 B
TypeScript
30 lines
645 B
TypeScript
import { CssBaseline } from '@mui/material';
|
|
import {
|
|
alpha,
|
|
createTheme as createMuiTheme,
|
|
css,
|
|
keyframes,
|
|
styled,
|
|
type ThemeOptions,
|
|
ThemeProvider as MuiThemeProvider,
|
|
} from '@mui/material/styles';
|
|
import type { PropsWithChildren } from 'react';
|
|
import { useMemo } from 'react';
|
|
|
|
export { alpha, css, keyframes, styled };
|
|
|
|
export const AffineMuiThemeProvider = ({
|
|
theme,
|
|
children,
|
|
}: PropsWithChildren<{
|
|
theme: ThemeOptions;
|
|
}>) => {
|
|
const muiTheme = useMemo(() => createMuiTheme(theme), [theme]);
|
|
return (
|
|
<MuiThemeProvider theme={muiTheme}>
|
|
<CssBaseline />
|
|
{children}
|
|
</MuiThemeProvider>
|
|
);
|
|
};
|