mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-24 20:36:40 +07:00
29 lines
737 B
TypeScript
29 lines
737 B
TypeScript
import { IModalState } from '~/redux/modal/index';
|
|
import { MODAL_ACTIONS } from '~/redux/modal/constants';
|
|
import { IFile } from '../types';
|
|
|
|
export const modalSet = (modal: Partial<IModalState>) => ({
|
|
type: MODAL_ACTIONS.SET,
|
|
modal,
|
|
});
|
|
|
|
export const modalSetShown = (is_shown: IModalState['is_shown']) => ({
|
|
is_shown,
|
|
type: MODAL_ACTIONS.SET_SHOWN,
|
|
});
|
|
|
|
export const modalSetDialog = (dialog: IModalState['dialog']) => ({
|
|
dialog,
|
|
type: MODAL_ACTIONS.SET_DIALOG,
|
|
});
|
|
|
|
export const modalShowDialog = (dialog: IModalState['dialog']) => ({
|
|
dialog,
|
|
type: MODAL_ACTIONS.SHOW_DIALOG,
|
|
});
|
|
|
|
export const modalShowPhotoswipe = (images: IFile[], index: number) => ({
|
|
type: MODAL_ACTIONS.SHOW_PHOTOSWIPE,
|
|
images,
|
|
index,
|
|
});
|