2020-03-30 15:26:15 +00:00
|
|
|
// @flow
|
|
|
|
|
|
|
|
import { SET_ACTIVE_MODAL_ID } from './actionTypes';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Action to set the ID of the active modal (or undefined if needs to be hidden).
|
|
|
|
*
|
|
|
|
* @param {string} activeModalId - The new modal ID or undefined.
|
2020-04-06 15:14:32 +00:00
|
|
|
* @param {Object} modalProps - The props to pass to the modal.
|
2020-03-30 15:26:15 +00:00
|
|
|
* @returns {{
|
|
|
|
* activeModalId: string,
|
|
|
|
* type: SET_ACTIVE_MODAL_ID
|
|
|
|
* }}
|
|
|
|
*/
|
2020-04-06 15:14:32 +00:00
|
|
|
export function setActiveModalId(activeModalId: ?string, modalProps: Object = {}) {
|
2020-03-30 15:26:15 +00:00
|
|
|
return {
|
|
|
|
activeModalId,
|
2020-04-06 15:14:32 +00:00
|
|
|
modalProps,
|
2020-03-30 15:26:15 +00:00
|
|
|
type: SET_ACTIVE_MODAL_ID
|
|
|
|
};
|
|
|
|
}
|