Web:Common:Fix loaders settings.
This commit is contained in:
parent
3d8e1b9c65
commit
68ac6c251b
@ -1,5 +1,6 @@
|
||||
import React, { useEffect } from "react";
|
||||
import PropTypes from "prop-types";
|
||||
import { useLocation } from "react-router";
|
||||
import Loaders from "@appserver/common/components/Loaders";
|
||||
import { isTablet as isTabletUtils } from "@appserver/components/utils/device";
|
||||
import { isTablet } from "react-device-detect";
|
||||
@ -21,15 +22,21 @@ const ArticleHeader = ({
|
||||
setIsLoadedArticleHeader,
|
||||
...rest
|
||||
}) => {
|
||||
const location = useLocation();
|
||||
|
||||
const isLoadedSetting = isLoaded;
|
||||
const commonSettings = location.pathname.includes("common");
|
||||
|
||||
const commonSettings =
|
||||
location.pathname.includes("common") || location.pathname === "/settings";
|
||||
|
||||
useEffect(() => {
|
||||
if (isLoadedSetting) setIsLoadedArticleHeader(isLoadedSetting);
|
||||
}, [isLoadedSetting]);
|
||||
|
||||
const heightLoader = isTabletUtils() || isTablet ? "20px" : "32px";
|
||||
|
||||
const showLoader = commonSettings ? !isLoadedPage : false;
|
||||
|
||||
return showLoader ? (
|
||||
<StyledArticleHeader>
|
||||
<Loaders.ArticleHeader height={heightLoader} className="loader" />
|
||||
|
Loading…
Reference in New Issue
Block a user