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

completely removed modal reducer

This commit is contained in:
Fedor Katurov 2022-01-04 20:30:23 +07:00
parent b1e8bddbaf
commit 8d5afb4f98
34 changed files with 189 additions and 300 deletions

View file

@ -0,0 +1,14 @@
import { makeAutoObservable } from 'mobx';
import { Dialog } from '~/constants/modal';
export class ModalStore {
current: Dialog | null = null;
constructor() {
makeAutoObservable(this);
}
setCurrent = (current: Dialog | null) => (this.current = current);
hide = () => (this.current = null);
}

View file

@ -0,0 +1,3 @@
import { useStore } from '~/utils/context/StoreContextProvider';
export const useModalStore = () => useStore().modal;