import React from "react"; import PropTypes from "prop-types"; import { useHistory } from "react-router"; import Loaders from "@docspace/common/components/Loaders"; import { isTablet as isTabletUtils } from "@docspace/components/utils/device"; import { Link } from "react-router-dom"; import { isTablet, isMobileOnly } from "react-device-detect"; import { inject, observer } from "mobx-react"; import { StyledArticleHeader, StyledHeading, StyledIconBox, } from "../styled-article"; const ArticleHeader = ({ showText, children, onClick, isBurgerLoading, ...rest }) => { const history = useHistory(); const isTabletView = (isTabletUtils() || isTablet) && !isMobileOnly; const onLogoClick = () => { if (showText && isTabletView) onClick(); else history.push("/"); }; if (isMobileOnly) return <>; return ( {isTabletView && isBurgerLoading ? ( ) : ( )} {!isTabletView && isBurgerLoading ? ( ) : ( {isTabletView ? ( ) : ( )} )} ); }; ArticleHeader.propTypes = { children: PropTypes.any, showText: PropTypes.bool, onClick: PropTypes.func, }; ArticleHeader.displayName = "Header"; export default inject(({ auth }) => { const { settingsStore } = auth; const { isBurgerLoading } = settingsStore; return { isBurgerLoading, }; })(observer(ArticleHeader));