DocSpace-buildtools/packages/common/store/InfoPanelStore.js

35 lines
674 B
JavaScript
Raw Normal View History

2022-02-08 12:11:31 +00:00
import { makeAutoObservable } from "mobx";
import { Events } from "@docspace/common/constants";
2022-02-08 12:11:31 +00:00
2022-02-11 14:35:18 +00:00
class InfoPanelStore {
isVisible = false;
2022-02-08 12:11:31 +00:00
constructor() {
makeAutoObservable(this);
}
2022-02-08 12:11:31 +00:00
toggleIsVisible = () => {
this.isVisible = !this.isVisible;
const event = new Event(Events.CHANGE_COLUMN);
window.dispatchEvent(event);
};
2022-02-10 13:18:16 +00:00
setVisible = () => {
this.isVisible = true;
const event = new Event(Events.CHANGE_COLUMN);
window.dispatchEvent(event);
};
setIsVisible = (bool) => {
this.isVisible = bool;
const event = new Event(Events.CHANGE_COLUMN);
window.dispatchEvent(event);
};
2022-02-08 12:11:31 +00:00
}
2022-02-11 14:35:18 +00:00
export default InfoPanelStore;