fix(learn): split and simplified learn map (#39154)
This commit is contained in:
committed by
Mrugesh Mohapatra
parent
48c97238fc
commit
ac3d762bb5
@ -122,7 +122,7 @@ exports.createSuperBlockIntroPages = createPage => edge => {
|
||||
path: slug,
|
||||
component: superBlockIntro,
|
||||
context: {
|
||||
superBlock: dasherize(superBlock),
|
||||
superBlock: superBlock,
|
||||
slug
|
||||
}
|
||||
});
|
||||
|
@ -11,6 +11,7 @@ export default function layoutSelector({ element, props }) {
|
||||
const {
|
||||
location: { pathname }
|
||||
} = props;
|
||||
|
||||
if (element.type === FourOhFourPage) {
|
||||
return <DefaultLayout pathname={pathname}>{element}</DefaultLayout>;
|
||||
}
|
||||
@ -22,10 +23,14 @@ export default function layoutSelector({ element, props }) {
|
||||
if (/^\/guide(\/.*)*/.test(pathname)) {
|
||||
console.log('Hitting guide for some reason. Need a redirect.');
|
||||
}
|
||||
if (
|
||||
/^\/learn(\/.*)*/.test(pathname) &&
|
||||
false === /^\/learn\/$|^\/learn$/.test(pathname)
|
||||
) {
|
||||
|
||||
const splitPath = pathname.split('/');
|
||||
const splitPathThree = splitPath.length > 2 ? splitPath[3] : '';
|
||||
|
||||
const isNotSuperBlockIntro =
|
||||
splitPath.length > 3 && splitPathThree.length > 1;
|
||||
|
||||
if (/^\/learn(\/.*)*/.test(pathname) && isNotSuperBlockIntro) {
|
||||
return (
|
||||
<DefaultLayout pathname={pathname} showFooter={false}>
|
||||
{element}
|
||||
|
Reference in New Issue
Block a user