From 5f16720abacda48ac1be6310851df71bf41efa87 Mon Sep 17 00:00:00 2001 From: TatianaLopaeva Date: Tue, 8 Jun 2021 13:40:59 +0300 Subject: [PATCH] Web: NavMenu: Was Done for tablet and mobile: - hide module name - added logo - added short logo fro mobile - changed width of logo --- public/images/personal.logo.react.svg | 2 +- .../NavMenu/sub-components/header.js | 58 +++++++++++++------ 2 files changed, 41 insertions(+), 19 deletions(-) diff --git a/public/images/personal.logo.react.svg b/public/images/personal.logo.react.svg index f0ca7c5520..589befbdce 100644 --- a/public/images/personal.logo.react.svg +++ b/public/images/personal.logo.react.svg @@ -1,4 +1,4 @@ - + diff --git a/web/ASC.Web.Client/src/components/NavMenu/sub-components/header.js b/web/ASC.Web.Client/src/components/NavMenu/sub-components/header.js index 01a35d4fb0..dd7d07385f 100644 --- a/web/ASC.Web.Client/src/components/NavMenu/sub-components/header.js +++ b/web/ASC.Web.Client/src/components/NavMenu/sub-components/header.js @@ -3,6 +3,7 @@ import { inject, observer } from "mobx-react"; import PropTypes from "prop-types"; import styled, { css } from "styled-components"; import { Link as LinkWithoutRedirect } from "react-router-dom"; +import { isMobileOnly } from "react-device-detect"; import NavItem from "./nav-item"; import Headline from "@appserver/common/components/Headline"; import Nav from "./nav"; @@ -17,6 +18,7 @@ import { desktop, tablet } from "@appserver/components/utils/device"; import i18n from "../i18n"; import { combineUrl } from "@appserver/common/utils"; import { AppServerConfig } from "@appserver/common/constants"; + const { proxyURL } = AppServerConfig; const backgroundColor = "#0F4071"; @@ -33,6 +35,7 @@ const Header = styled.header` ${(props) => props.module && + !props.isPersonal && css` @media ${tablet} { display: none; @@ -45,9 +48,7 @@ const Header = styled.header` font-size: 21px; line-height: 0; margin-top: -5px; - cursor: ${(props) => (props.isPersonal ? "default" : "pointer")}; - - ${(props) => props.isPersonal && `margin-left: 16px;`} + cursor: "pointer"; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-user-drag: none; @@ -76,17 +77,28 @@ const Header = styled.header` } .header-logo-icon { - width: ${(props) => (props.isPersonal ? "254px" : "146px")}; - ${(props) => props.isPersonal && `margin-left: 17px;`} + width: ${(props) => (props.isPersonal ? "220px" : "146px")}; + ${(props) => props.isPersonal && `margin-left: 20px;`} height: 24px; position: relative; - padding: 0 20px 0 6px; + padding: ${(props) => (!props.isPersonal ? "0 20px 0 6px" : "0")}; cursor: pointer; - @media (max-width: 620px) { - display: ${(props) => (props.module ? "none" : "block")}; - padding: 0px 20px 0 6px; + @media ${tablet} { + ${(props) => props.isPersonal && `margin-left: 16px;`} } + + @media (max-width: 620px) { + ${(props) => + !props.isPersonal && + css` + display: ${(props) => (props.module ? "none" : "block")}; + padding: 0px 20px 0 6px; + `} + } + } + .mobile-short-logo { + width: 146px; } `; @@ -178,7 +190,7 @@ const HeaderComponent = ({ {!isPersonal ? ( logo - ) : ( + ) : !isMobileOnly ? ( logo + ) : ( + )} - - {currentProductName} - + {!isPersonal && ( + + {currentProductName} + + )} {isNavAvailable && (