2024-07-09 07:08:47 +00:00
|
|
|
import React from 'react';
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
import Logo from './logo';
|
|
|
|
import CommonToolbar from './toolbar/common-toolbar';
|
|
|
|
|
2024-07-11 09:45:30 +00:00
|
|
|
import './header.css';
|
|
|
|
|
2024-07-09 07:08:47 +00:00
|
|
|
const propTypes = {
|
2024-07-11 09:45:30 +00:00
|
|
|
children: PropTypes.object,
|
|
|
|
eventBus: PropTypes.object.isRequired,
|
2024-07-09 07:08:47 +00:00
|
|
|
isSidePanelClosed: PropTypes.bool,
|
|
|
|
onCloseSidePanel: PropTypes.func,
|
|
|
|
onShowSidePanel: PropTypes.func,
|
|
|
|
onSearchedClick: PropTypes.func,
|
|
|
|
searchPlaceholder: PropTypes.string,
|
|
|
|
showSearch: PropTypes.bool
|
|
|
|
};
|
|
|
|
|
|
|
|
class Header extends React.Component {
|
|
|
|
|
|
|
|
render() {
|
2024-07-11 09:45:30 +00:00
|
|
|
const { onShowSidePanel, onSearchedClick, showSearch, children } = this.props;
|
2024-07-09 07:08:47 +00:00
|
|
|
return (
|
2024-07-11 09:45:30 +00:00
|
|
|
<div id="header" className="top-header d-flex justify-content-between flex-shrink-0">
|
2024-07-09 07:08:47 +00:00
|
|
|
<div className={'flex-shrink-0 d-none d-md-flex'}>
|
|
|
|
<Logo onCloseSidePanel={this.props.onCloseSidePanel} />
|
|
|
|
</div>
|
2024-07-11 09:45:30 +00:00
|
|
|
<div className={`flex-shrink-0 d-flex flex-fill ${children ? 'border-left-show' : ''}`}>
|
2024-07-09 07:08:47 +00:00
|
|
|
<div className="cur-view-toolbar">
|
|
|
|
<span title="Side Nav Menu" onClick={onShowSidePanel} className="sf2-icon-menu side-nav-toggle hidden-md-up d-md-none">
|
|
|
|
</span>
|
2024-07-11 09:45:30 +00:00
|
|
|
{children}
|
2024-07-09 07:08:47 +00:00
|
|
|
</div>
|
|
|
|
<CommonToolbar
|
|
|
|
showSearch={showSearch}
|
|
|
|
searchPlaceholder={this.props.searchPlaceholder}
|
|
|
|
onSearchedClick={onSearchedClick}
|
2024-07-11 09:45:30 +00:00
|
|
|
eventBus={this.props.eventBus}
|
2024-07-09 07:08:47 +00:00
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Header.propTypes = propTypes;
|
|
|
|
|
|
|
|
export default Header;
|