bigbuffet-rw/app/soapbox/actions/modals.ts

20 lines
391 B
TypeScript
Raw Normal View History

2020-03-27 13:59:38 -07:00
export const MODAL_OPEN = 'MODAL_OPEN';
export const MODAL_CLOSE = 'MODAL_CLOSE';
/** Open a modal of the given type */
export function openModal(type: string, props?: any) {
2020-03-27 13:59:38 -07:00
return {
type: MODAL_OPEN,
modalType: type,
modalProps: props,
};
2021-08-03 12:22:51 -07:00
}
2020-03-27 13:59:38 -07:00
/** Close the modal */
2022-05-27 11:08:41 -07:00
export function closeModal(type?: string) {
2020-03-27 13:59:38 -07:00
return {
type: MODAL_CLOSE,
modalType: type,
2020-03-27 13:59:38 -07:00
};
2021-08-03 12:22:51 -07:00
}