fix(footer): change nonLearnPage to showFooter

This commit is contained in:
Valeriy
2019-02-17 14:47:20 +03:00
committed by Stuart Taylor
parent 71cf52144e
commit 1a889d9f3f
3 changed files with 12 additions and 28 deletions

View File

@ -30,28 +30,20 @@ export const wrapPageElement = ({ element, props }) => {
} = props;
if (pathname === '/') {
return (
<DefaultLayout
disableSettings={true}
landingPage={true}
nonLearnPage={true}
>
<DefaultLayout disableSettings={true} landingPage={true}>
{element}
</DefaultLayout>
);
}
if ((/^\/guide(\/.*)*/).test(pathname)) {
return (
<DefaultLayout nonLearnPage={true}>
<DefaultLayout>
<GuideLayout>{element}</GuideLayout>
</DefaultLayout>
);
}
if (false === (/^\/learn(\/.*)*/).test(pathname)) {
return (
<DefaultLayout nonLearnPage={true}>
{element}
</DefaultLayout>
);
if ((/^\/learn(\/.*)*/).test(pathname)) {
return <DefaultLayout showFooter={false}>{element}</DefaultLayout>;
}
return <DefaultLayout>{element}</DefaultLayout>;
};

View File

@ -30,28 +30,20 @@ export const wrapPageElement = ({ element, props }) => {
} = props;
if (pathname === '/') {
return (
<DefaultLayout
disableSettings={true}
landingPage={true}
nonLearnPage={true}
>
<DefaultLayout disableSettings={true} landingPage={true}>
{element}
</DefaultLayout>
);
}
if ((/^\/guide(\/.*)*/).test(pathname)) {
return (
<DefaultLayout nonLearnPage={true}>
<DefaultLayout>
<GuideLayout>{element}</GuideLayout>
</DefaultLayout>
);
}
if (false === (/^\/learn(\/.*)*/).test(pathname)) {
return (
<DefaultLayout nonLearnPage={true}>
{element}
</DefaultLayout>
);
if ((/^\/learn(\/.*)*/).test(pathname)) {
return <DefaultLayout showFooter={false}>{element}</DefaultLayout>;
}
return <DefaultLayout>{element}</DefaultLayout>;
};

View File

@ -69,9 +69,9 @@ const propTypes = {
isOnline: PropTypes.bool.isRequired,
isSignedIn: PropTypes.bool,
landingPage: PropTypes.bool,
nonLearnPage: PropTypes.bool,
onlineStatusChange: PropTypes.func.isRequired,
removeFlashMessage: PropTypes.func.isRequired
removeFlashMessage: PropTypes.func.isRequired,
showFooter: PropTypes.bool
};
const mapStateToProps = createSelector(
@ -139,7 +139,7 @@ class DefaultLayout extends Component {
flashMessages = [],
removeFlashMessage,
landingPage,
nonLearnPage,
showFooter = true,
isOnline,
isSignedIn
} = this.props;
@ -166,7 +166,7 @@ class DefaultLayout extends Component {
) : null}
{children}
</div>
{nonLearnPage ? (<Footer />) : null}
{showFooter && (<Footer />)}
</Fragment>
);
}