feat: improve ui/ux learn map (#40579)

Co-authored-by: Kris Koishigawa <scissorsneedfoodtoo@gmail.com>
This commit is contained in:
Tom
2021-01-13 07:09:45 -06:00
committed by Mrugesh Mohapatra
parent 14ca6beb0a
commit 625469c82f
45 changed files with 3297 additions and 965 deletions

View File

@ -49,21 +49,6 @@ const getPrevChallengePath = (node, index, nodeArray) => {
const getTemplateComponent = challengeType => views[viewTypes[challengeType]];
const getIntroIfRequired = (node, index, nodeArray) => {
const next = nodeArray[index + 1];
const isEndOfBlock = next && next.node.challengeOrder === 0;
let nextSuperBlock = '';
let nextBlock = '';
if (next) {
const { superBlock, block } = next.node;
nextSuperBlock = superBlock;
nextBlock = block;
}
return isEndOfBlock
? `/learn/${dasherize(nextSuperBlock)}/${dasherize(nextBlock)}`
: '';
};
exports.createChallengePages = createPage => ({ node }, index, thisArray) => {
const {
superBlock,
@ -84,7 +69,6 @@ exports.createChallengePages = createPage => ({ node }, index, thisArray) => {
challengeMeta: {
superBlock,
block: block,
introPath: getIntroIfRequired(node, index, thisArray),
template,
required,
nextChallengePath: getNextChallengePath(node, index, thisArray),