fix(client): only show live certifications (#57602)

This commit is contained in:
Oliver Eyton-Williams
2024-12-18 18:44:45 +01:00
committed by GitHub
parent 91c9b10e58
commit 174eec287a
2 changed files with 34 additions and 11 deletions

View File

@@ -25,7 +25,8 @@ import {
signInLoadingSelector
} from '../../redux/selectors';
import type { ChallengeNode, User } from '../../redux/prop-types';
import { CertTitle } from '../../../config/cert-and-project-map';
import { CertTitle, liveCerts } from '../../../config/cert-and-project-map';
import { superBlockToCertMap } from '../../../../shared/config/certification-settings';
import Block from './components/block';
import CertChallenge from './components/cert-challenge';
import LegacyLinks from './components/legacy-links';
@@ -187,15 +188,9 @@ const SuperBlockIntroductionPage = (props: SuperBlockProp) => {
const i18nTitle = getSuperBlockTitleForMap(superBlock);
const superblockWithoutCert = [
SuperBlocks.RespWebDesign,
SuperBlocks.CodingInterviewPrep,
SuperBlocks.TheOdinProject,
SuperBlocks.ProjectEuler,
SuperBlocks.A2English,
SuperBlocks.RosettaCode,
SuperBlocks.PythonForEverybody
];
const showCertification = liveCerts.some(
cert => superBlockToCertMap[superBlock] === cert.certSlug
);
const superBlockWithAccordionView = [SuperBlocks.FullStackDeveloper];
const chosenBlock = getChosenBlock();
@@ -255,7 +250,7 @@ const SuperBlockIntroductionPage = (props: SuperBlockProp) => {
/>
);
})}
{!superblockWithoutCert.includes(superBlock) && (
{showCertification && (
<CertChallenge
certification={certification}
superBlock={superBlock}