Web:People:Components:Catalog: fix loaders for main button and header with isLoaded prop

This commit is contained in:
Timofey Boyko 2022-03-15 14:21:53 +03:00
parent 87bd5b9c29
commit 3c092803ea
2 changed files with 8 additions and 4 deletions

View File

@ -5,13 +5,14 @@ import { inject, observer } from "mobx-react";
const CatalogHeaderContent = ({
isVisitor,
isLoading,
isLoaded,
firstLoad,
currentModuleName,
}) => {
return (
!isVisitor &&
(firstLoad ? (
isLoading ? (
(firstLoad || !isLoaded ? (
isLoading || !isLoaded ? (
<Loaders.ArticleHeader />
) : (
<>{currentModuleName}</>
@ -27,6 +28,7 @@ export default inject(({ auth, peopleStore }) => {
return {
isVisitor: auth.userStore.user.isVisitor,
isLoading: loadingStore.isLoading,
isLoaded: loadingStore.isLoaded,
firstLoad: loadingStore.firstLoad,
currentModuleName: auth.product.title,
};

View File

@ -76,6 +76,7 @@ class CatalogMainButtonContent extends React.Component {
sectionWidth,
isLoading,
firstLoad,
isLoaded,
} = this.props;
const { dialogVisible } = this.state;
@ -156,8 +157,8 @@ class CatalogMainButtonContent extends React.Component {
buttonOptions={links}
sectionWidth={sectionWidth}
/>
) : firstLoad ? (
isLoading ? (
) : firstLoad || !isLoaded ? (
isLoading || !isLoaded ? (
<Loaders.MainButton />
) : (
<MainButton
@ -210,6 +211,7 @@ export default withRouter(
groupCaption,
toggleShowText: auth.settingsStore.toggleShowText,
isLoading: loadingStore.isLoading,
isLoaded: loadingStore.isLoaded,
firstLoad: loadingStore.firstLoad,
};
})(