Skip to content

Commit 1523637

Browse files
committed
Remove call of hook outside of react component
1 parent 6a53cd2 commit 1523637

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

src/lib/mui.tsx

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@ import type { PaletteOptions as MuiPaletteOptions } from "@mui/material/styles/c
99
import { getColorDecisions } from "./generatedFromCss/getColorDecisions";
1010
import { getColorOptions } from "./generatedFromCss/getColorOptions";
1111
import { useIsDark } from "./useColorScheme";
12+
import { breakpoints } from "./breakpoints";
1213

1314
function createMuiDsfrThemeFromTheme(params: { isDark: boolean }): MuiTheme {
1415
const { isDark } = params;
1516

16-
const palette = useMemo(() => createMuiPaletteOptions({ isDark }), [isDark]);
17+
const palette = createMuiPaletteOptions({ isDark });
1718

1819
const muiTheme = createMuiTheme({
1920
"shape": {
@@ -41,9 +42,15 @@ function createMuiDsfrThemeFromTheme(params: { isDark: boolean }): MuiTheme {
4142
"xl": number,
4243
},
4344
},
44-
"typography": createMuiTypographyOptions({
45-
typographyDesc,
46-
}),
45+
"typography": {
46+
"h1": {
47+
"color": "red",
48+
[breakpoints.up("md")]: {
49+
"color": "pink"
50+
}
51+
52+
}
53+
}
4754
"palette": createMuiPaletteOptions({
4855
isDarkModeEnabled,
4956
palette,

0 commit comments

Comments
 (0)