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

36 lines
620 B
JavaScript
Raw Normal View History

2022-02-08 12:11:31 +00:00
import { makeAutoObservable } from "mobx";
2022-02-11 14:35:18 +00:00
class InfoPanelStore {
selection = null;
isVisible = false;
roomView = "members";
itemView = "history";
2022-02-08 12:11:31 +00:00
constructor() {
makeAutoObservable(this);
}
2022-02-08 12:11:31 +00:00
setSelection = (selection) => {
this.selection = selection;
2022-08-09 16:05:36 +00:00
};
toggleIsVisible = () => {
this.isVisible = !this.isVisible;
};
2022-02-10 13:18:16 +00:00
setVisible = () => {
this.isVisible = true;
};
setIsVisible = (bool) => {
this.isVisible = bool;
};
setView = (view) => {
this.roomView = view;
this.itemView = view === "members" ? "history" : view;
};
2022-02-08 12:11:31 +00:00
}
2022-02-11 14:35:18 +00:00
export default InfoPanelStore;