2023-03-29 17:58:23 +00:00
|
|
|
import { createTheme } from '@mui/material';
|
2023-11-09 04:10:43 +00:00
|
|
|
import { THEME_COLOR } from './constants';
|
2023-03-30 07:15:34 +00:00
|
|
|
import { getColors } from './colors';
|
2023-03-29 17:58:23 +00:00
|
|
|
import { getComponents } from './components';
|
|
|
|
import { getPallette } from './palette';
|
|
|
|
import { typography } from './typography';
|
2023-11-09 04:10:43 +00:00
|
|
|
import { APPS } from '@ente/shared/apps/constants';
|
2023-03-29 17:58:23 +00:00
|
|
|
|
2023-04-14 10:58:53 +00:00
|
|
|
export const getTheme = (themeColor: THEME_COLOR, appName: APPS) => {
|
|
|
|
const colors = getColors(themeColor, appName);
|
|
|
|
const palette = getPallette(themeColor, colors);
|
2023-03-30 07:15:34 +00:00
|
|
|
const components = getComponents(colors, typography);
|
2023-03-29 17:58:23 +00:00
|
|
|
const theme = createTheme({
|
2023-03-30 07:15:34 +00:00
|
|
|
colors,
|
2023-03-29 17:58:23 +00:00
|
|
|
palette,
|
|
|
|
typography,
|
|
|
|
components,
|
2023-03-30 07:15:34 +00:00
|
|
|
shape: {
|
|
|
|
borderRadius: 8,
|
|
|
|
},
|
2023-05-29 08:05:02 +00:00
|
|
|
transitions: {
|
|
|
|
duration: { leavingScreen: 300 },
|
|
|
|
},
|
2023-03-29 17:58:23 +00:00
|
|
|
});
|
|
|
|
return theme;
|
|
|
|
};
|