fix(ui): use inline vars resolver instead of Modal.extend

Modal.extend() is not available at module evaluation time in the
Next.js/Turbopack ESM context, causing a runtime TypeError. Define
the vars resolver as a plain object in createTheme's components key.
This commit is contained in:
Thomas Camlong committed 2026-05-14 17:00:26 +02:00
1 parent bef275804c
commit 904bef50d8
1 file changed
+4 -4
+4 -4
View File
@@ -1,4 +1,4 @@
import { createTheme, Modal } from "@mantine/core"; import { createTheme } from "@mantine/core";
import { primaryColor } from "./theme/colors/primary"; import { primaryColor } from "./theme/colors/primary";
import { secondaryColor } from "./theme/colors/secondary"; import { secondaryColor } from "./theme/colors/secondary";
@@ -10,13 +10,13 @@ export const theme = createTheme({
}, },
primaryColor: "primaryColor", primaryColor: "primaryColor",
components: { components: {
Modal: Modal.extend({ Modal: {
vars: (_theme, props) => { vars: (_theme: unknown, props: { size?: string }) => {
if (props.size === "xxl") { if (props.size === "xxl") {
return { root: { "--modal-size": "75rem" } }; return { root: { "--modal-size": "75rem" } };
} }
return { root: {} }; return { root: {} };
}, },
}), },
}, },
}); });