Rewrite actions/modal and reducers/modal with typescript (#24833)
This commit is contained in:
parent
4197b5e4c8
commit
38c6216082
38 changed files with 503 additions and 261 deletions
17
app/javascript/mastodon/actions/modal.ts
Normal file
17
app/javascript/mastodon/actions/modal.ts
Normal file
|
@ -0,0 +1,17 @@
|
|||
import { createAction } from '@reduxjs/toolkit';
|
||||
|
||||
import type { MODAL_COMPONENTS } from '../features/ui/components/modal_root';
|
||||
|
||||
export type ModalType = keyof typeof MODAL_COMPONENTS;
|
||||
|
||||
interface OpenModalPayload {
|
||||
modalType: ModalType;
|
||||
modalProps: unknown;
|
||||
}
|
||||
export const openModal = createAction<OpenModalPayload>('MODAL_OPEN');
|
||||
|
||||
interface CloseModalPayload {
|
||||
modalType: ModalType | undefined;
|
||||
ignoreFocus: boolean;
|
||||
}
|
||||
export const closeModal = createAction<CloseModalPayload>('MODAL_CLOSE');
|
Loading…
Add table
Add a link
Reference in a new issue