refactor: only use dasherized superBlock (#41067)

This commit is contained in:
Oliver Eyton-Williams
2021-02-13 06:06:04 +01:00
committed by GitHub
parent 73f8377d68
commit 97fcaa693f
22 changed files with 68 additions and 87 deletions

View File

@@ -141,12 +141,10 @@ export class SuperBlockIntroductionPage extends Component {
t
} = this.props;
const superBlockDashedName = dasherize(superBlock);
const nodesForSuperBlock = edges.map(({ node }) => node);
const blockDashedNames = uniq(nodesForSuperBlock.map(({ block }) => block));
const i18nSuperBlock = t(`intro:${superBlockDashedName}.title`);
const i18nSuperBlock = t(`intro:${superBlock}.title`);
return (
<>
@@ -171,12 +169,12 @@ export class SuperBlockIntroductionPage extends Component {
challenges={nodesForSuperBlock.filter(
node => node.block === blockDashedName
)}
superBlockDashedName={superBlockDashedName}
superBlockDashedName={superBlock}
/>
{blockDashedName !== 'project-euler' ? <Spacer /> : null}
</Fragment>
))}
{superBlock !== 'Coding Interview Prep' && (
{superBlock !== 'coding-interview-prep' && (
<div>
<CertChallenge superBlock={superBlock} />
</div>