The useModal
hook will provide openModal
and closeModal
functions that can be used in your component.
openModal(MODAL_NAME, props)
opens a modal with the provided propscloseModal(MODAL_NAME)
closes the modalonRequestClose
is automatically provided to the modal as a prop, defaults to just closing the modal but can be overriddenonAfterClose
can be set from propas well
- Make a modal content component
- Add a new modal name constant under
constants/modal
- Add the modal to the modal name map in
components/modal/ModalUtils
The modal controller component was designed so that every component can only open one of each modal. This will need to be changed if a component ever needs to open more than one of the same modal.