Theme fix

master
Tudor Stanciu 2024-04-01 01:14:21 +03:00
parent 6798057b2d
commit c6a3290891
2 changed files with 17 additions and 17 deletions

View File

@ -1,17 +1,19 @@
import { ThemeOptions } from "@mui/material/styles";
const primary = "#00695C"; const primary = "#00695C";
const secondary = "#DC7633"; const secondary = "#DC7633";
const warning = "#ff9800"; const warning = "#ff9800";
const success = "#4caf50"; const success = "#4caf50";
const info = "#2196f3"; const info = "#2196f3";
const defaultTheme = { export const theme: ThemeOptions = {
palette: { palette: {
mode: "light",
primary: { primary: {
main: primary main: primary
}, },
secondary: { secondary: {
main: secondary main: secondary
// contrastText: "#ffcc00"
}, },
warning: { warning: {
main: warning main: warning
@ -22,14 +24,7 @@ const defaultTheme = {
info: { info: {
main: info main: info
} }
},
overrides: {
MuiBackdrop: {
root: {
backgroundColor: "#4A4A4A1A"
}
}
} }
}; };
export default defaultTheme; export default theme;

View File

@ -1,5 +1,9 @@
import defaultTheme from "./default"; import defaultTheme from "./default";
import { createTheme } from "@mui/material/styles"; import { createTheme, Theme } from "@mui/material/styles";
type Themes = {
default: Theme;
};
const overrides = { const overrides = {
typography: { typography: {
@ -24,15 +28,16 @@ const overrides = {
} }
}; };
const getThemes = darkMode => { const getThemes = (darkMode: boolean): Themes => {
const type = darkMode ? "dark" : "light"; const type = darkMode ? "dark" : "light";
const dTheme = createTheme({
return {
default: createTheme({
...defaultTheme, ...defaultTheme,
...overrides, ...overrides,
palette: { ...defaultTheme.palette, type } palette: { ...defaultTheme.palette, mode: type }
}) });
return {
default: dTheme
}; };
}; };