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; } = props;
if (pathname === '/') { if (pathname === '/') {
return ( return (
<DefaultLayout <DefaultLayout disableSettings={true} landingPage={true}>
disableSettings={true}
landingPage={true}
nonLearnPage={true}
>
{element} {element}
</DefaultLayout> </DefaultLayout>
); );
} }
if ((/^\/guide(\/.*)*/).test(pathname)) { if ((/^\/guide(\/.*)*/).test(pathname)) {
return ( return (
<DefaultLayout nonLearnPage={true}> <DefaultLayout>
<GuideLayout>{element}</GuideLayout> <GuideLayout>{element}</GuideLayout>
</DefaultLayout> </DefaultLayout>
); );
} }
if (false === (/^\/learn(\/.*)*/).test(pathname)) { if ((/^\/learn(\/.*)*/).test(pathname)) {
return ( return <DefaultLayout showFooter={false}>{element}</DefaultLayout>;
<DefaultLayout nonLearnPage={true}>
{element}
</DefaultLayout>
);
} }
return <DefaultLayout>{element}</DefaultLayout>; return <DefaultLayout>{element}</DefaultLayout>;
}; };

View File

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

View File

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