feat: render footer correctly (#42096)

Co-authored-by: Ahmad Abdolsaheb <ahmad.abdolsaheb@gmail.com>
This commit is contained in:
saeed
2021-05-24 03:00:07 +04:30
committed by GitHub
parent 4714e033c8
commit 66c5523909
2 changed files with 36 additions and 4 deletions

View File

@ -26,11 +26,12 @@ export default function layoutSelector({ element, props }) {
}
const splitPath = pathname.split('/').filter(x => x);
const isSuperBlock =
(splitPath.length === 2 && splitPath[0]) === 'learn' ||
(splitPath.length === 3 && splitPath[1]) === 'learn';
if (/\/learn\//.test(pathname) && !isSuperBlock) {
const isChallenge =
(splitPath.length === 4 && splitPath[0]) === 'learn' ||
(splitPath.length === 5 && splitPath[1]) === 'learn';
if (isChallenge) {
return (
<DefaultLayout pathname={pathname} showFooter={false}>
{element}