bigbuffet-rw/app/soapbox/actions/modals.ts
marcin mikołajczak c76639c42e JS -> TS, FC
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2022-11-12 15:18:24 +01:00

21 lines
474 B
TypeScript

import type { ModalType } from 'soapbox/features/ui/components/modal_root';
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) {
return {
type: MODAL_OPEN,
modalType: type,
modalProps: props,
};
}
/** Close the modal */
export function closeModal(type?: ModalType) {
return {
type: MODAL_CLOSE,
modalType: type,
};
}