Web: NavMenu: Was Done for tablet and mobile:

- hide module name
- added logo
- added short logo fro mobile
- changed width of logo
This commit is contained in:
Tatiana Lopaeva 2021-06-08 13:40:59 +03:00
parent 9d5e2ab828
commit 5f16720aba
2 changed files with 41 additions and 19 deletions

View File

@ -1,4 +1,4 @@
<svg width="254" height="24" viewBox="0 0 254 24" fill="none" xmlns="http://www.w3.org/2000/svg"> <svg width="220" height="24" viewBox="0 0 220 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M10.9387 23.7057L0.656893 18.7625C-0.218964 18.331 -0.218964 17.664 0.656893 17.2717L4.23648 15.5455L10.9006 18.7625C11.7765 19.1941 13.1855 19.1941 14.0232 18.7625L20.6874 15.5455L24.2669 17.2717C25.1428 17.7033 25.1428 18.3702 24.2669 18.7625L13.9852 23.7057C13.1855 24.098 11.7765 24.098 10.9387 23.7057Z" fill="#FF6F3D"/> <path fill-rule="evenodd" clip-rule="evenodd" d="M10.9387 23.7057L0.656893 18.7625C-0.218964 18.331 -0.218964 17.664 0.656893 17.2717L4.23648 15.5455L10.9006 18.7625C11.7765 19.1941 13.1855 19.1941 14.0232 18.7625L20.6874 15.5455L24.2669 17.2717C25.1428 17.7033 25.1428 18.3702 24.2669 18.7625L13.9852 23.7057C13.1855 24.098 11.7765 24.098 10.9387 23.7057Z" fill="#FF6F3D"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M10.9387 17.6249L0.656893 12.6817C-0.218964 12.2501 -0.218964 11.5832 0.656893 11.1909L4.16032 9.50391L10.9387 12.7601C11.8145 13.1917 13.2235 13.1917 14.0613 12.7601L20.8397 9.50391L24.3431 11.1909C25.219 11.6224 25.219 12.2894 24.3431 12.6817L14.0613 17.6249C13.1855 18.0564 11.7765 18.0564 10.9387 17.6249Z" fill="#95C038"/> <path fill-rule="evenodd" clip-rule="evenodd" d="M10.9387 17.6249L0.656893 12.6817C-0.218964 12.2501 -0.218964 11.5832 0.656893 11.1909L4.16032 9.50391L10.9387 12.7601C11.8145 13.1917 13.2235 13.1917 14.0613 12.7601L20.8397 9.50391L24.3431 11.1909C25.219 11.6224 25.219 12.2894 24.3431 12.6817L14.0613 17.6249C13.1855 18.0564 11.7765 18.0564 10.9387 17.6249Z" fill="#95C038"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M10.9387 11.7008L0.656893 6.75765C-0.218964 6.3261 -0.218964 5.65916 0.656893 5.26684L10.9387 0.323661C11.8145 -0.107887 13.2235 -0.107887 14.0613 0.323661L24.3431 5.26684C25.219 5.69839 25.219 6.36533 24.3431 6.75765L14.0613 11.7008C13.1855 12.0931 11.7765 12.0931 10.9387 11.7008Z" fill="#5DC0E8"/> <path fill-rule="evenodd" clip-rule="evenodd" d="M10.9387 11.7008L0.656893 6.75765C-0.218964 6.3261 -0.218964 5.65916 0.656893 5.26684L10.9387 0.323661C11.8145 -0.107887 13.2235 -0.107887 14.0613 0.323661L24.3431 5.26684C25.219 5.69839 25.219 6.36533 24.3431 6.75765L14.0613 11.7008C13.1855 12.0931 11.7765 12.0931 10.9387 11.7008Z" fill="#5DC0E8"/>

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

@ -3,6 +3,7 @@ import { inject, observer } from "mobx-react";
import PropTypes from "prop-types"; import PropTypes from "prop-types";
import styled, { css } from "styled-components"; import styled, { css } from "styled-components";
import { Link as LinkWithoutRedirect } from "react-router-dom"; import { Link as LinkWithoutRedirect } from "react-router-dom";
import { isMobileOnly } from "react-device-detect";
import NavItem from "./nav-item"; import NavItem from "./nav-item";
import Headline from "@appserver/common/components/Headline"; import Headline from "@appserver/common/components/Headline";
import Nav from "./nav"; import Nav from "./nav";
@ -17,6 +18,7 @@ import { desktop, tablet } from "@appserver/components/utils/device";
import i18n from "../i18n"; import i18n from "../i18n";
import { combineUrl } from "@appserver/common/utils"; import { combineUrl } from "@appserver/common/utils";
import { AppServerConfig } from "@appserver/common/constants"; import { AppServerConfig } from "@appserver/common/constants";
const { proxyURL } = AppServerConfig; const { proxyURL } = AppServerConfig;
const backgroundColor = "#0F4071"; const backgroundColor = "#0F4071";
@ -33,6 +35,7 @@ const Header = styled.header`
${(props) => ${(props) =>
props.module && props.module &&
!props.isPersonal &&
css` css`
@media ${tablet} { @media ${tablet} {
display: none; display: none;
@ -45,9 +48,7 @@ const Header = styled.header`
font-size: 21px; font-size: 21px;
line-height: 0; line-height: 0;
margin-top: -5px; margin-top: -5px;
cursor: ${(props) => (props.isPersonal ? "default" : "pointer")}; cursor: "pointer";
${(props) => props.isPersonal && `margin-left: 16px;`}
-webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
-webkit-user-drag: none; -webkit-user-drag: none;
@ -76,18 +77,29 @@ const Header = styled.header`
} }
.header-logo-icon { .header-logo-icon {
width: ${(props) => (props.isPersonal ? "254px" : "146px")}; width: ${(props) => (props.isPersonal ? "220px" : "146px")};
${(props) => props.isPersonal && `margin-left: 17px;`} ${(props) => props.isPersonal && `margin-left: 20px;`}
height: 24px; height: 24px;
position: relative; position: relative;
padding: 0 20px 0 6px; padding: ${(props) => (!props.isPersonal ? "0 20px 0 6px" : "0")};
cursor: pointer; cursor: pointer;
@media ${tablet} {
${(props) => props.isPersonal && `margin-left: 16px;`}
}
@media (max-width: 620px) { @media (max-width: 620px) {
${(props) =>
!props.isPersonal &&
css`
display: ${(props) => (props.module ? "none" : "block")}; display: ${(props) => (props.module ? "none" : "block")};
padding: 0px 20px 0 6px; padding: 0px 20px 0 6px;
`}
} }
} }
.mobile-short-logo {
width: 146px;
}
`; `;
const StyledLink = styled.div` const StyledLink = styled.div`
@ -178,7 +190,7 @@ const HeaderComponent = ({
<LinkWithoutRedirect className="header-logo-wrapper" to={defaultPage}> <LinkWithoutRedirect className="header-logo-wrapper" to={defaultPage}>
{!isPersonal ? ( {!isPersonal ? (
<img alt="logo" src={props.logoUrl} className="header-logo-icon" /> <img alt="logo" src={props.logoUrl} className="header-logo-icon" />
) : ( ) : !isMobileOnly ? (
<img <img
alt="logo" alt="logo"
className="header-logo-icon" className="header-logo-icon"
@ -187,17 +199,27 @@ const HeaderComponent = ({
"/static/images/personal.logo.react.svg" "/static/images/personal.logo.react.svg"
)} )}
/> />
) : (
<img
className="header-logo-icon mobile-short-logo"
src={combineUrl(
AppServerConfig.proxyURL,
"/static/images/nav.logo.opened.react.svg"
)}
/>
)} )}
</LinkWithoutRedirect> </LinkWithoutRedirect>
{!isPersonal && (
<Headline <Headline
className="header-module-title" className="header-module-title"
type="header" type="header"
color="#FFF" color="#FFF"
{...(!isPersonal && { onClick: onClick })} onClick={onClick}
> >
{currentProductName} {currentProductName}
</Headline> </Headline>
)}
</Header> </Header>
{isNavAvailable && ( {isNavAvailable && (