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:
1 file changed
+4
-4
@@ -1,4 +1,4 @@
|
||||
import { createTheme, Modal } from "@mantine/core";
|
||||
import { createTheme } from "@mantine/core";
|
||||
|
||||
import { primaryColor } from "./theme/colors/primary";
|
||||
import { secondaryColor } from "./theme/colors/secondary";
|
||||
@@ -10,13 +10,13 @@ export const theme = createTheme({
|
||||
},
|
||||
primaryColor: "primaryColor",
|
||||
components: {
|
||||
Modal: Modal.extend({
|
||||
vars: (_theme, props) => {
|
||||
Modal: {
|
||||
vars: (_theme: unknown, props: { size?: string }) => {
|
||||
if (props.size === "xxl") {
|
||||
return { root: { "--modal-size": "75rem" } };
|
||||
}
|
||||
return { root: {} };
|
||||
},
|
||||
}),
|
||||
},
|
||||
},
|
||||
});
|
||||
Reference in new issue
Block a user