fix(client): fix v7 certlocation (#41565)

pull/41566/merge
Shaun Hamilton 2021-03-24 14:58:13 +00:00 committed by GitHub
parent 0fea83bac5
commit 3aad0808ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 3 deletions

View File

@ -132,7 +132,7 @@ export class SuperBlockIntroductionPage extends Component {
const {
data: {
markdownRemark: {
frontmatter: { superBlock }
frontmatter: { superBlock, title }
},
allChallengeNode: { edges }
},
@ -175,7 +175,7 @@ export class SuperBlockIntroductionPage extends Component {
))}
{superBlock !== 'coding-interview-prep' && (
<div>
<CertChallenge superBlock={superBlock} />
<CertChallenge superBlock={superBlock} title={title} />
</div>
)}
</div>
@ -216,6 +216,7 @@ export const query = graphql`
markdownRemark(fields: { slug: { eq: $slug } }) {
frontmatter {
superBlock
title
}
}
allChallengeNode(

View File

@ -10,10 +10,12 @@ import GreenPass from '../../../assets/icons/GreenPass';
import GreenNotCompleted from '../../../assets/icons/GreenNotCompleted';
import { userSelector } from '../../../redux';
import { User } from '../../../redux/propTypes';
import { certMap } from '../../../resources/certAndProjectMap';
const propTypes = {
superBlock: PropTypes.string,
t: PropTypes.func,
title: PropTypes.string,
user: User
};
@ -28,6 +30,7 @@ export class CertChallenge extends Component {
const {
superBlock,
t,
title,
user: {
is2018DataVisCert,
isApisMicroservicesCert,
@ -56,8 +59,9 @@ export class CertChallenge extends Component {
'machine-learning-with-python': isMachineLearningPyCertV7
};
const cert = certMap.find(x => x.title === title);
const isCertified = userCertificates[superBlock];
const certLocation = `/certification/${username}/${superBlock}`;
const certLocation = `/certification/${username}/${cert.slug}`;
const certCheckmarkStyle = { height: '40px', width: '40px' };
const i18nSuperBlock = t(`intro:${superBlock}.title`);
const i18nCertText = t(`intro:misc-text.certification`, {