Web:People:Components:Catalog: fix loaders for main button and header with isLoaded prop
This commit is contained in:
parent
87bd5b9c29
commit
3c092803ea
@ -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,
|
||||
};
|
||||
|
@ -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,
|
||||
};
|
||||
})(
|
||||
|
Loading…
Reference in New Issue
Block a user