51 lines
1.3 KiB
JavaScript
51 lines
1.3 KiB
JavaScript
import React, { Component } from 'react';
|
|
import PropTypes, { func } from 'prop-types';
|
|
import autobind from 'autobind-decorator';
|
|
import HeaderSearchFieldContainer from './../AppContent/HeaderSearchFieldContainer';
|
|
import { useSelector } from 'react-redux';
|
|
import { connect } from 'react-redux';
|
|
import LangDropMenu from './LangDropMenu';
|
|
@autobind
|
|
class _ContentHeader extends Component {
|
|
constructor(props) {
|
|
super(props);
|
|
this.state = {
|
|
searching: true
|
|
};
|
|
}
|
|
render() {
|
|
return <div className='ContentHeader'>
|
|
<HeaderSearchFieldContainer showClose={false} />
|
|
<LangDropMenu />
|
|
</div>
|
|
}
|
|
}
|
|
|
|
const mapStateToProps = state => {
|
|
return {
|
|
color: state.urls.color,
|
|
scrollingText: state.urls.scrollingText
|
|
};
|
|
};
|
|
const ContentHeader = connect(mapStateToProps)(_ContentHeader);
|
|
export default ContentHeader;
|
|
|
|
function _HeaderTitle({ t }) {
|
|
const siteName = useSelector(state => state.urls.name);
|
|
return <h1 className='HeaderTitle big-text'>{siteName}</h1>;
|
|
}
|
|
_HeaderTitle.propTypes = {
|
|
t: PropTypes.func.isRequired
|
|
};
|
|
|
|
const HeaderSearchBtn = ({ handler }) => (
|
|
<div className='HeaderSearchBtn'>
|
|
<button onClick={handler}>
|
|
<img src='/static/gfx/alps_lupe.svg' alt='search' />
|
|
</button>
|
|
</div>
|
|
);
|
|
|
|
HeaderSearchBtn.propTypes = {
|
|
handler: PropTypes.func.isRequired
|
|
};
|