feat: improve ui/ux learn map (#40579)
Co-authored-by: Kris Koishigawa <scissorsneedfoodtoo@gmail.com>
This commit is contained in:
@ -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),
|
||||
|
Reference in New Issue
Block a user