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:
parent
224c27b6f4
commit
82308d2a91
15 changed files with 90 additions and 84 deletions
|
@ -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 = {};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue