temp
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { createTheme, Shadows, ThemeOptions } from '@mui/material/styles';
|
||||
import { useTheme as useMuiTheme, Theme } from '@mui/material/styles';
|
||||
import { amber, red } from '@mui/material/colors';
|
||||
import { ThemeProvider } from '@mui/material/styles';
|
||||
const generateShadows = (color: string): Shadows => {
|
||||
return [
|
||||
'none',
|
||||
@@ -139,6 +140,20 @@ export const themeOptions: ThemeOptions = {
|
||||
*/
|
||||
export const theme = createTheme(themeOptions);
|
||||
|
||||
/**
|
||||
*
|
||||
* @returns
|
||||
*/
|
||||
export const useTheme = () => {
|
||||
return useMuiTheme<Theme>();
|
||||
};
|
||||
|
||||
/**
|
||||
* 自定义主题设置。
|
||||
* @param param0
|
||||
* @returns
|
||||
*/
|
||||
export const CustomThemeProvider = ({ children, themeOptions: customThemeOptions }: { children: React.ReactNode; themeOptions?: ThemeOptions }) => {
|
||||
const theme = createTheme(customThemeOptions || themeOptions);
|
||||
return <ThemeProvider theme={theme}>{children}</ThemeProvider>;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user