2019-01-08 10:48:57 +01:00
|
|
|
import React from 'react';
|
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
|
import { Link, withRouter } from 'react-router-dom';
|
2019-01-17 17:00:21 +01:00
|
|
|
import { Dropdown } from "react-viewerbase";
|
2019-01-08 10:48:57 +01:00
|
|
|
import './Header.css';
|
|
|
|
|
import list from './HeaderMenuList.json';
|
2019-01-17 17:00:21 +01:00
|
|
|
//import Icons from "../../images/icons.svg";
|
|
|
|
|
|
|
|
|
|
const Icons = '/icons.svg';
|
2019-01-08 10:48:57 +01:00
|
|
|
|
|
|
|
|
function Header({ home, location }) {
|
2019-01-01 12:23:17 +01:00
|
|
|
const { state } = location
|
|
|
|
|
|
2018-12-29 15:02:18 +01:00
|
|
|
return (
|
2019-01-01 12:23:17 +01:00
|
|
|
<div className={`entry-header ${home ? 'header-big' : ''}`}>
|
|
|
|
|
<div className='header-left-box'>
|
|
|
|
|
{
|
|
|
|
|
state && state.studyLink &&
|
|
|
|
|
<Link to={state.studyLink} className="header-btn header-viewerLink">
|
|
|
|
|
Back to Viewer
|
|
|
|
|
</Link>
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
<a target="_blank" rel="noopener noreferrer" className="header-brand" href="http://ohif.org">
|
|
|
|
|
<svg className="header-logo-image">
|
|
|
|
|
<use xlinkHref={`${Icons}#icon-ohif-logo`} />
|
|
|
|
|
</svg>
|
|
|
|
|
<div className="header-logo-text">Open Health Imaging Foundation</div>
|
|
|
|
|
</a>
|
|
|
|
|
|
|
|
|
|
{!home &&
|
|
|
|
|
<Link className='header-btn header-studyListLinkSection' to={{
|
|
|
|
|
pathname: "/",
|
|
|
|
|
state: { studyLink: location.pathname }
|
|
|
|
|
}}>Study list</Link>
|
|
|
|
|
}
|
|
|
|
|
</div>
|
2018-12-29 15:02:18 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
<div className="header-menu">
|
2019-01-07 14:00:54 +01:00
|
|
|
<span className="research-use">
|
|
|
|
|
INVESTIGATIONAL USE ONLY
|
|
|
|
|
</span>
|
2018-12-29 15:02:18 +01:00
|
|
|
<Dropdown
|
|
|
|
|
title='Options'
|
|
|
|
|
list={list}
|
|
|
|
|
align='right'
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
2019-01-08 10:48:57 +01:00
|
|
|
Header.propTypes = {
|
|
|
|
|
home: PropTypes.bool.isRequired,
|
|
|
|
|
location: PropTypes.object.isRequired
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
Header.defaultProps = {
|
|
|
|
|
home: true
|
|
|
|
|
};
|
|
|
|
|
|
2019-01-01 12:23:17 +01:00
|
|
|
export default withRouter(Header)
|