new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Mantine · all subjects

modals/contextmodals

4 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

Context modals definition

You can define multiple context modals by passing a modals object to ModalsProvider. Each key in the modals object should map to a React component that accepts ContextModalProps with generic type for innerProps, containing properties context (for closing/updating), id (modal instance id), and innerProps (custom modal data).

openContextModal function usage

The modals.openContextModal function accepts 2 arguments: the modal key (must match a key defined in ModalsProvider modals object) and an object containing modal configuration properties like title and innerProps.

Type-safe context modals with TypeScript

To add type safety for context modals in TypeScript, declare a module augmentation for '@mantine/modals' and export an interface MantineModalsOverride with a modals property set to the typeof your modals object. This forces correct typing when using openContextModal.

ContextModalProps type structure

ContextModalProps is a generic TypeScript type that accepts a type parameter for innerProps. It provides context (object with closeModal and updateModal methods), id (the modal instance id), and innerProps (custom data passed to the modal).

Give your agent this brain