[Glitch] Rewrite actions/modal and reducers/modal with typescript
Port 38c6216082
to glitch-soc
Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
committed by
Claire
parent
6a592083f1
commit
382b2a506a
17
app/javascript/flavours/glitch/actions/modal.ts
Normal file
17
app/javascript/flavours/glitch/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');
|
Reference in New Issue
Block a user