fix(client): set --header-height only if Header exists

This commit is contained in:
Valeriy
2019-09-01 03:40:49 +03:00
committed by Mrugesh Mohapatra
parent d161459109
commit 9ce4331e25
5 changed files with 19 additions and 15 deletions

View File

@ -1,5 +1,6 @@
import React from 'react'; import React from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import Helmet from 'react-helmet';
import SearchBar from '../search/searchBar/SearchBar'; import SearchBar from '../search/searchBar/SearchBar';
import NavigationMenu from './components/NavMenu'; import NavigationMenu from './components/NavMenu';
@ -15,6 +16,10 @@ const propTypes = {
function Header(props) { function Header(props) {
const { disableSettings } = props; const { disableSettings } = props;
return ( return (
<>
<Helmet>
<style>{':root{--header-height: 38px}'}</style>
</Helmet>
<header> <header>
<nav id='top-nav'> <nav id='top-nav'>
<Link className='home-link' to='/'> <Link className='home-link' to='/'>
@ -24,6 +29,7 @@ function Header(props) {
<NavigationMenu disableSettings={disableSettings} /> <NavigationMenu disableSettings={disableSettings} />
</nav> </nav>
</header> </header>
</>
); );
} }

View File

@ -15,12 +15,11 @@ body {
} }
.default-layout { .default-layout {
margin-top: var(--header-height); margin-top: var(--header-height, 0px);
background: var(--secondary-background); background: var(--secondary-background);
display: flex; display: flex;
flex-direction: column; flex-direction: column;
margin-top: var(--header-height); min-height: calc(100vh - var(--header-height, 0px));
min-height: calc(100vh - var(--header-height));
} }
h1 { h1 {

View File

@ -1,5 +1,5 @@
#learn-app-wrapper .desktop-layout { #learn-app-wrapper .desktop-layout {
height: calc(100vh - var(--header-height)); height: calc(100vh - var(--header-height, 0px));
} }
#learn-app-wrapper .reflex-container.vertical > .reflex-splitter, #learn-app-wrapper .reflex-container.vertical > .reflex-splitter,

View File

@ -1,5 +1,4 @@
:root { :root {
--header-height: 38px;
--theme-color: #0a0a23; --theme-color: #0a0a23;
--gray-00: #ffffff; --gray-00: #ffffff;
--gray-05: #f5f6f7; --gray-05: #f5f6f7;

View File

@ -26,7 +26,7 @@
} }
#challenge-page-tabs .tab-content { #challenge-page-tabs .tab-content {
height: calc(100vh - var(--header-height) - 69px); height: calc(100vh - var(--header-height, 0px) - 69px);
overflow-y: auto; overflow-y: auto;
} }