#346: remove currently not needed showHeader prop

This commit is contained in:
SleepWalker 2017-08-08 07:20:06 +03:00
parent 89d42a7363
commit 77847a3474

View File

@ -35,7 +35,6 @@ class RootPage extends Component {
user: User, user: User,
isPopupActive: boolean, isPopupActive: boolean,
onLogoClick: Function, onLogoClick: Function,
displayHeader: ?boolean,
location: { location: {
pathname: string pathname: string
} }
@ -56,11 +55,11 @@ class RootPage extends Component {
render() { render() {
const props = this.props; const props = this.props;
const {user, displayHeader} = this.props; const {user, isPopupActive, onLogoClick} = this.props;
const isRegisterPage = props.location.pathname === '/register'; const isRegisterPage = props.location.pathname === '/register';
if (document && document.body) { if (document && document.body) {
document.body.style.overflow = props.isPopupActive ? 'hidden' : ''; document.body.style.overflow = isPopupActive ? 'hidden' : '';
} }
return ( return (
@ -69,22 +68,20 @@ class RootPage extends Component {
<html lang={user.lang} /> <html lang={user.lang} />
</Helmet> </Helmet>
<div id="view-port" className={classNames(styles.viewPort, { <div id="view-port" className={classNames(styles.viewPort, {
[styles.isPopupActive]: props.isPopupActive [styles.isPopupActive]: isPopupActive
})}> })}>
{displayHeader === false ? '' : ( <div className={styles.header}>
<div className={styles.header}> <div className={styles.headerContent}>
<div className={styles.headerContent}> <Link to="/" className={styles.logo} onClick={onLogoClick}>
<Link to="/" className={styles.logo} onClick={props.onLogoClick}> <Message {...messages.siteName} />
<Message {...messages.siteName} /> </Link>
</Link> <div className={styles.userbar}>
<div className={styles.userbar}> <Userbar {...props}
<Userbar {...props} guestAction={isRegisterPage ? 'login' : 'register'}
guestAction={isRegisterPage ? 'login' : 'register'} />
/>
</div>
</div> </div>
</div> </div>
)} </div>
<div className={styles.body}> <div className={styles.body}>
<Switch> <Switch>
<PrivateRoute path="/profile" component={ProfilePage} /> <PrivateRoute path="/profile" component={ProfilePage} />