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

22 lines
474 B
TypeScript
Raw Normal View History

2022-11-16 05:32:32 -08:00
import type { ModalType } from 'soapbox/features/ui/components/modal-root';
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: ModalType, 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 */
export function closeModal(type?: ModalType) {
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
}