Improve modals reducer types (#26610)

This commit is contained in:
Renaud Chaput 2023-09-22 16:41:50 +02:00 committed by GitHub
commit b93ffb74bb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 33 deletions

View file

@ -1,12 +1,14 @@
import { createAction } from '@reduxjs/toolkit';
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;
modalProps: unknown;
modalProps: ModalProps;
}
export const openModal = createAction<OpenModalPayload>('MODAL_OPEN');