mastodon-glitch/app/javascript/mastodon/actions/modal.ts

20 lines
564 B
TypeScript
Raw Normal View History

import { createAction } from '@reduxjs/toolkit';
2023-09-22 14:41:50 +00:00
import type { ModalProps } from 'mastodon/reducers/modal';
import type { MODAL_COMPONENTS } from '../features/ui/components/modal_root';
export type ModalType = keyof typeof MODAL_COMPONENTS;
interface OpenModalPayload {
modalType: ModalType;
2023-09-22 14:41:50 +00:00
modalProps: ModalProps;
}
export const openModal = createAction<OpenModalPayload>('MODAL_OPEN');
interface CloseModalPayload {
modalType: ModalType | undefined;
ignoreFocus: boolean;
}
export const closeModal = createAction<CloseModalPayload>('MODAL_CLOSE');