mirror of
https://github.com/elyby/accounts-frontend.git
synced 2024-12-26 23:10:20 +05:30
#346: remove currently not needed showHeader prop
This commit is contained in:
parent
89d42a7363
commit
77847a3474
@ -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} />
|
||||||
|
Loading…
Reference in New Issue
Block a user