Fix: Header shouldn’t be sticky on Viewer Route

This commit is contained in:
Gustavo Lelis 2020-04-14 09:11:34 -03:00 committed by James A. Petts
parent 68b8b04a1c
commit 7dccf77c7d
3 changed files with 8 additions and 4 deletions

View File

@ -2,11 +2,14 @@ import React from 'react';
import PropTypes from 'prop-types';
import classnames from 'classnames';
const NavBar = ({ className, children }) => {
const stickyClasses = 'sticky top-0 z-10';
const NavBar = ({ className, children, isSticky }) => {
return (
<div
className={classnames(
'flex flex-row items-center bg-secondary-dark px-3 py-1 sticky top-0 z-10 border-b-4 border-black',
'flex flex-row items-center bg-secondary-dark px-3 py-1 border-b-4 border-black',
isSticky && stickyClasses,
className
)}
>
@ -18,6 +21,7 @@ const NavBar = ({ className, children }) => {
NavBar.propTypes = {
className: PropTypes.string,
children: PropTypes.node,
isSticky: PropTypes.bool,
};
export default NavBar;

View File

@ -298,7 +298,7 @@ components.
'h-screen': !hasStudies,
})}
>
<NavBar className="justify-between border-b-4 border-black">
<NavBar className="justify-between border-b-4 border-black" isSticky>
<div className="flex items-center">
<div className="mx-3">
<Svg name="logo-ohif" />

View File

@ -12,7 +12,7 @@ function Header({ appLogo = OHIFLogo(), children, t }) {
};
return (
<NavBar className="justify-between">
<NavBar className="justify-between" isSticky>
<div className="flex items-center">
<div className="mx-3">{appLogo}</div>
<div>{children}</div>