From dfaa34ac39de2c80da2a4a29471727727cd6df3a Mon Sep 17 00:00:00 2001 From: Dmitry Sychugov Date: Tue, 1 Feb 2022 12:59:42 +0500 Subject: [PATCH] Web: Common: added main bar --- .../components/PageLayout/index.js | 66 ++++++++++++------- 1 file changed, 43 insertions(+), 23 deletions(-) diff --git a/packages/asc-web-common/components/PageLayout/index.js b/packages/asc-web-common/components/PageLayout/index.js index b4f76f90ba..0e04bdc2fe 100644 --- a/packages/asc-web-common/components/PageLayout/index.js +++ b/packages/asc-web-common/components/PageLayout/index.js @@ -22,6 +22,8 @@ import FloatingButton from "../FloatingButton"; import { inject, observer } from "mobx-react"; import Selecto from "react-selecto"; import styled, { css } from "styled-components"; +import { LayoutContextConsumer } from "studio/Layout/context"; +import classnames from "classnames"; const StyledSelectoWrapper = styled.div` .selecto-selection { @@ -31,22 +33,23 @@ const StyledSelectoWrapper = styled.div` const StyledMainBar = styled.div` box-sizing: border-box; + @media ${desktop} { + margin-left: -24px; + max-width: ${(props) => props.width + 40 + "px"}; + } - ${!isMobile - ? css` - padding-right: 24px; - @media ${tablet} { - padding-right: 16px; - } - ` - : css` - margin-top: 10px; - padding-right: 0px; - - @media ${desktop} { - padding-right: 10px; - } - `} + @media ${tablet} { + margin-left: -16px; + max-width: ${(props) => props.width + 36 + "px"}; + } + ${isMobile && + css` + z-index: 149; + // min-width: 100%; + position: fixed; + // padding-left: 8px; + top: 48px; + `}; `; function ArticleHeader() { @@ -239,6 +242,7 @@ class PageLayout extends React.Component { isArticlePinned, isDesktop, isHomepage, + maintenanceExist, } = this.props; let articleHeaderContent = null; let articleMainButtonContent = null; @@ -370,16 +374,30 @@ class PageLayout extends React.Component { pinned={isArticlePinned} visible={isArticleVisible} > -
- - {sectionBarContent - ? sectionBarContent.props.children - : null} - -
- {/*
*/} + + {(value) => ( + + + {sectionBarContent + ? sectionBarContent.props.children + : null} + + + )} + + {isSectionHeaderAvailable && ( { setIsArticleVisible, setIsBackdropVisible, isDesktopClient, + maintenanceExist, } = settingsStore; return { @@ -586,6 +605,7 @@ export default inject(({ auth }) => { setIsArticleVisible, isBackdropVisible, setIsBackdropVisible, + maintenanceExist, isDesktop: isDesktopClient, }; })(observer(PageLayout));