import React, { Component } from 'react';
import PropTypes, { func } from 'prop-types';
import autobind from 'autobind-decorator';
import HeaderSearchFieldContainer from './HeaderSearchFieldContainer';
import reduxLang from '../../middleware/lang';
import BurgerBtnContainer from '../AppMenu/BurgerBtnContainer';
import { useSelector } from 'react-redux'
import { connect } from 'react-redux';
@autobind
class _ContentHeader extends Component {
constructor(props) {
super(props);
this.state = {
searching: false
};
}
toggleSearching() {
this.setState({ searching: !this.state.searching });
}
render() {
const { searching } = this.state;
const { isPreLaunch, color, scrollingText } = this.props;
return searching ? (
) : (
<>
{!isPreLaunch && }
>
);
}
}
const mapStateToProps = state => {
return {
color: state.urls.color,
scrollingText: state.urls.scrollingText
};
};
const ContentHeader = connect(mapStateToProps)(_ContentHeader);
export default ContentHeader;
function HeaderIcon() {
const currentSite = useSelector(state => state.urls.site);
const allSites = Object.getOwnPropertyNames(useSelector(state => state.urls.allSites))
const siteID = allSites.findIndex((siteName) => siteName === currentSite) + 1;
return № {siteID}
;
}
const getTitle = t => {
if ('ontouchstart' in window || navigator.msMaxTouchPoints > 0) {
return 'Fundbüro № 1';
} else {
return t('skiing');
}
};
function _HeaderTitle({ t }) {
const siteName = useSelector(state => state.urls.name);
return {siteName}
;
}
_HeaderTitle.propTypes = {
t: PropTypes.func.isRequired
};
const HeaderTitle = reduxLang('HeaderTitle')(_HeaderTitle);
const HeaderSearchBtn = ({ handler }) => (
);
HeaderSearchBtn.propTypes = {
handler: PropTypes.func.isRequired
};