#howto modal
Under /app/scripts/apps/internet.jsx:
const modalProps = {
show: this.state.modalPayload.modalOpen,
onHide: this.closeModal,
container: document.body,
dialogClassName: 'modal-fullscreen',
'aria-labelledby': 'contained-modal-title'
};
and in render:
<Modal { ...modalProps } >
<SidebarModalContainer
{ ...modalPayload.payload }/>
</Modal>
and this.closeModal:
closeModal() {
ModalActions.closeModal();
}
To open a modal, use: ModalActions.fetchModal({ url: 'foo/bar/baz' });
This fetches the modal from the API and triggers the modal to open.
The app receives the modal data as
this.state.modalPayload
I still need to figure out how to accept different templates besides SidebarModalContainer, or we can adapt it to show multiple templates.