Theme fix

master^2
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 secondary = "#DC7633";
const warning = "#ff9800";
const success = "#4caf50";
const info = "#2196f3";
const defaultTheme = {
export const theme: ThemeOptions = {
palette: {
mode: "light",
primary: {
main: primary
},
secondary: {
main: secondary
// contrastText: "#ffcc00"
},
warning: {
main: warning
@ -22,14 +24,7 @@ const defaultTheme = {
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 { createTheme } from "@mui/material/styles";
import { createTheme, Theme } from "@mui/material/styles";
type Themes = {
default: Theme;
};
const overrides = {
typography: {
@ -24,15 +28,16 @@ const overrides = {
}
};
const getThemes = darkMode => {
const getThemes = (darkMode: boolean): Themes => {
const type = darkMode ? "dark" : "light";
const dTheme = createTheme({
...defaultTheme,
...overrides,
palette: { ...defaultTheme.palette, mode: type }
});
return {
default: createTheme({
...defaultTheme,
...overrides,
palette: { ...defaultTheme.palette, type }
})
default: dTheme
};
};