Web: move BannerStore from Client to Common

This commit is contained in:
Timofey Boyko 2023-03-17 18:36:31 +03:00
parent df849a52a4
commit 64a4271a8a
5 changed files with 12 additions and 8 deletions

View File

@ -236,8 +236,8 @@ ProfileMenu.propTypes = {
clickOutsideAction: PropTypes.func,
};
export default inject(({ bannerStore }) => {
const { isBannerVisible } = bannerStore;
export default inject(({ auth }) => {
const { isBannerVisible } = auth.bannerStore;
return { isBannerVisible };
})(observer(ProfileMenu));

View File

@ -96,9 +96,9 @@ const ReactSmartBanner = (props) => {
);
};
export default inject(({ bannerStore }) => {
export default inject(({ auth }) => {
return {
isBannerVisible: bannerStore.isBannerVisible,
setIsBannerVisible: bannerStore.setIsBannerVisible,
isBannerVisible: auth.bannerStore.isBannerVisible,
setIsBannerVisible: auth.bannerStore.setIsBannerVisible,
};
})(observer(ReactSmartBanner));

View File

@ -5,7 +5,7 @@ import SettingsSetupStore from "./SettingsSetupStore";
import ConfirmStore from "./ConfirmStore";
import BackupStore from "./BackupStore";
import CommonStore from "./CommonStore";
import BannerStore from "./BannerStore";
import ProfileActionsStore from "./ProfileActionsStore";
import SsoFormStore from "./SsoFormStore";
@ -30,6 +30,7 @@ import selectFileDialogStore from "./SelectFileDialogStore";
import TagsStore from "./TagsStore";
import PeopleStore from "./PeopleStore";
import OformsStore from "./OformsStore";
import AccessRightsStore from "./AccessRightsStore";
import TableStore from "./TableStore";
import CreateEditRoomStore from "./CreateEditRoomStore";
@ -44,7 +45,6 @@ const setupStore = new SettingsSetupStore();
const confirmStore = new ConfirmStore();
const backupStore = new BackupStore();
const commonStore = new CommonStore();
const bannerStore = new BannerStore();
const ssoStore = new SsoFormStore();
@ -168,7 +168,7 @@ const store = {
confirm: confirmStore,
backup: backupStore,
common: commonStore,
bannerStore,
ssoStore,
profileActionsStore,

View File

@ -3,6 +3,7 @@ import api from "../api";
import { setWithCredentialsStatus } from "../api/client";
import SettingsStore from "./SettingsStore";
import BannerStore from "./BannerStore";
import UserStore from "./UserStore";
import TfaStore from "./TfaStore";
import InfoPanelStore from "./InfoPanelStore";
@ -11,6 +12,7 @@ import { isAdmin, setCookie, getCookie } from "../utils";
import CurrentQuotasStore from "./CurrentQuotaStore";
import CurrentTariffStatusStore from "./CurrentTariffStatusStore";
import PaymentQuotasStore from "./PaymentQuotasStore";
import { LANGUAGE, COOKIE_EXPIRATION_YEAR, TenantStatus } from "../constants";
class AuthStore {
@ -37,6 +39,8 @@ class AuthStore {
this.currentQuotaStore = new CurrentQuotasStore();
this.currentTariffStatusStore = new CurrentTariffStatusStore();
this.paymentQuotasStore = new PaymentQuotasStore();
this.bannerStore = new BannerStore();
makeAutoObservable(this);
}