2019-01-31 08:55:05 +01:00
|
|
|
import React, { Component } from 'react';
|
2019-01-08 10:48:57 +01:00
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
|
import { Link, withRouter } from 'react-router-dom';
|
2019-01-24 14:00:01 +01:00
|
|
|
import { Dropdown } from 'react-viewerbase';
|
2019-01-08 10:48:57 +01:00
|
|
|
import './Header.css';
|
2019-01-24 14:00:01 +01:00
|
|
|
import OHIFLogo from '../OHIFLogo/OHIFLogo.js';
|
2019-01-31 08:55:05 +01:00
|
|
|
import ConnectedUserPreferencesModal from '../../connectedComponents/ConnectedUserPreferencesModal.js';
|
2019-01-08 10:48:57 +01:00
|
|
|
|
2019-01-31 08:55:05 +01:00
|
|
|
class Header extends Component {
|
|
|
|
|
static propTypes = {
|
|
|
|
|
home: PropTypes.bool.isRequired,
|
|
|
|
|
location: PropTypes.object.isRequired,
|
|
|
|
|
openUserPreferencesModal: PropTypes.func,
|
|
|
|
|
children: PropTypes.node
|
|
|
|
|
};
|
2019-01-24 14:00:01 +01:00
|
|
|
|
2019-01-31 08:55:05 +01:00
|
|
|
static defaultProps = {
|
|
|
|
|
home: true,
|
|
|
|
|
children: OHIFLogo()
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
constructor(props) {
|
|
|
|
|
super(props);
|
|
|
|
|
|
|
|
|
|
this.state = {
|
|
|
|
|
userPreferencesOpen: false
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
this.options = [
|
|
|
|
|
{
|
|
|
|
|
title: 'Preferences ',
|
|
|
|
|
icon: 'fa fa-user',
|
|
|
|
|
onClick: this.props.openUserPreferencesModal
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: 'About',
|
|
|
|
|
icon: 'fa fa-info',
|
|
|
|
|
link: 'http://ohif.org'
|
|
|
|
|
}
|
|
|
|
|
];
|
2019-01-24 14:00:01 +01:00
|
|
|
}
|
2019-01-01 12:23:17 +01:00
|
|
|
|
2019-01-31 08:55:05 +01:00
|
|
|
render() {
|
|
|
|
|
return (
|
|
|
|
|
<div className={`entry-header ${this.props.home ? 'header-big' : ''}`}>
|
|
|
|
|
<div className="header-left-box">
|
|
|
|
|
{this.props.location && this.props.location.studyLink && (
|
|
|
|
|
<Link
|
|
|
|
|
to={this.props.location.studyLink}
|
|
|
|
|
className="header-btn header-viewerLink"
|
|
|
|
|
>
|
|
|
|
|
Back to Viewer
|
|
|
|
|
</Link>
|
|
|
|
|
)}
|
2018-12-29 15:02:18 +01:00
|
|
|
|
2019-01-31 08:55:05 +01:00
|
|
|
{this.props.children}
|
2018-12-29 15:02:18 +01:00
|
|
|
|
2019-01-31 08:55:05 +01:00
|
|
|
{!this.props.home && (
|
|
|
|
|
<Link
|
|
|
|
|
className="header-btn header-studyListLinkSection"
|
|
|
|
|
to={{
|
|
|
|
|
pathname: '/',
|
|
|
|
|
state: { studyLink: this.props.location.pathname }
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
Study list
|
|
|
|
|
</Link>
|
|
|
|
|
)}
|
|
|
|
|
</div>
|
2019-01-08 10:48:57 +01:00
|
|
|
|
2019-01-31 08:55:05 +01:00
|
|
|
<div className="header-menu">
|
|
|
|
|
<span className="research-use">INVESTIGATIONAL USE ONLY</span>
|
|
|
|
|
<Dropdown title="Options" list={this.options} align="right" />
|
|
|
|
|
<ConnectedUserPreferencesModal />
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
2019-01-08 10:48:57 +01:00
|
|
|
|
2019-01-24 14:00:01 +01:00
|
|
|
export default withRouter(Header);
|