mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-04-27 19:00:42 -04:00
fix(curriculum): make the title show with proper format (#50912)
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
This commit is contained in:
@@ -39,7 +39,7 @@ exports[`should check certification page consistency 1`] = `
|
||||
gatsby="true"
|
||||
href="/learn/2022/responsive-web-design/learn-accessibility-by-building-a-quiz/step-41"
|
||||
>
|
||||
Learn Accessibility by Building a Quiz - Step 41
|
||||
Step 41
|
||||
</a>
|
||||
</td>
|
||||
<td />
|
||||
|
||||
@@ -242,6 +242,8 @@ function useIdToNameMap(t: TFunction): Map<string, NameMap> {
|
||||
blockName
|
||||
}
|
||||
id
|
||||
superBlock
|
||||
hasEditableBoundaries
|
||||
title
|
||||
}
|
||||
}
|
||||
@@ -265,15 +267,20 @@ function useIdToNameMap(t: TFunction): Map<string, NameMap> {
|
||||
// @ts-expect-error Graphql needs typing
|
||||
id,
|
||||
// @ts-expect-error Graphql needs typing
|
||||
superBlock,
|
||||
// @ts-expect-error Graphql needs typing
|
||||
title,
|
||||
// @ts-expect-error Graphql needs typing
|
||||
fields: { slug, blockName }
|
||||
fields: { slug, blockName },
|
||||
// @ts-expect-error Graphql needs typing
|
||||
hasEditableBoundaries
|
||||
}
|
||||
}
|
||||
}) => {
|
||||
const blockNameTitle = t(`intro:${superBlock}.blocks.${blockName}.title`);
|
||||
idToNameMap.set(id, {
|
||||
challengeTitle: `${
|
||||
title.includes('Step') ? `${blockName} - ` : ''
|
||||
hasEditableBoundaries ? blockNameTitle + ' - ' : ''
|
||||
}${title}`,
|
||||
challengePath: slug
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user