1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-26 05:16:41 +07:00

removed PhotoSwipeStore

This commit is contained in:
Fedor Katurov 2022-01-07 20:37:49 +07:00
parent 224c27b6f4
commit 82308d2a91
15 changed files with 90 additions and 84 deletions

View file

@ -1,14 +1,22 @@
import { makeAutoObservable } from 'mobx';
import { Dialog } from '~/constants/modal';
import { DialogContentProps } from '~/hooks/modal/useModal';
export class ModalStore {
current: Dialog | null = null;
props: object | undefined;
constructor() {
makeAutoObservable(this);
}
setCurrent = (current: Dialog | null) => (this.current = current);
setCurrent = <T extends Dialog>(current: T, props: DialogContentProps[T]) => {
this.props = props;
this.current = current ?? {};
};
hide = () => (this.current = null);
hide = () => {
this.current = null;
this.props = {};
};
}