fix(footer): show only on non-learn pages

This commit is contained in:
Mrugesh Mohapatra
2019-02-17 16:26:10 +05:30
committed by Stuart Taylor
parent b94c87494c
commit 71cf52144e
4 changed files with 37 additions and 15 deletions

View File

@ -6,7 +6,7 @@ import { createStore } from './src/redux/createStore';
import AppMountNotifier from './src/components/AppMountNotifier';
import GuideNavContextProvider from './src/contexts/GuideNavigationContext';
import DefaultLayout from './src/components/layouts/Default';
import GuideLayout from './src/components/layouts/GuideLayout';
import GuideLayout from './src/components/layouts/Guide';
const store = createStore();
@ -30,18 +30,29 @@ export const wrapPageElement = ({ element, props }) => {
} = props;
if (pathname === '/') {
return (
<DefaultLayout disableSettings={true} landingPage={true}>
<DefaultLayout
disableSettings={true}
landingPage={true}
nonLearnPage={true}
>
{element}
</DefaultLayout>
);
}
if ((/^\/guide(\/.*)*/).test(pathname)) {
return (
<DefaultLayout>
<DefaultLayout nonLearnPage={true}>
<GuideLayout>{element}</GuideLayout>
</DefaultLayout>
);
}
if (false === (/^\/learn(\/.*)*/).test(pathname)) {
return (
<DefaultLayout nonLearnPage={true}>
{element}
</DefaultLayout>
);
}
return <DefaultLayout>{element}</DefaultLayout>;
};