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