Merge pull request #16481 from lgrzybowski/fix/remove_star_from_map
fix(map): Removed required sign from challenges
This commit is contained in:
@ -20,7 +20,6 @@ const propTypes = {
|
|||||||
isCompleted: PropTypes.bool,
|
isCompleted: PropTypes.bool,
|
||||||
isDev: PropTypes.bool,
|
isDev: PropTypes.bool,
|
||||||
isLocked: PropTypes.bool,
|
isLocked: PropTypes.bool,
|
||||||
isRequired: PropTypes.bool,
|
|
||||||
title: PropTypes.string
|
title: PropTypes.string
|
||||||
};
|
};
|
||||||
const mapDispatchToProps = { clickOnChallenge };
|
const mapDispatchToProps = { clickOnChallenge };
|
||||||
@ -38,7 +37,6 @@ function makeMapStateToProps(_, { dashedName }) {
|
|||||||
title,
|
title,
|
||||||
block,
|
block,
|
||||||
isLocked,
|
isLocked,
|
||||||
isRequired,
|
|
||||||
isComingSoon
|
isComingSoon
|
||||||
} = challengeMap[dashedName] || {};
|
} = challengeMap[dashedName] || {};
|
||||||
const isCompleted = userChallengeMap ? !!userChallengeMap[id] : false;
|
const isCompleted = userChallengeMap ? !!userChallengeMap[id] : false;
|
||||||
@ -48,7 +46,6 @@ function makeMapStateToProps(_, { dashedName }) {
|
|||||||
title,
|
title,
|
||||||
block,
|
block,
|
||||||
isLocked,
|
isLocked,
|
||||||
isRequired,
|
|
||||||
isComingSoon,
|
isComingSoon,
|
||||||
isDev: debug.enabled('fcc:*')
|
isDev: debug.enabled('fcc:*')
|
||||||
};
|
};
|
||||||
@ -64,13 +61,6 @@ export class Challenge extends PureComponent {
|
|||||||
return <span className='sr-only'>completed</span>;
|
return <span className='sr-only'>completed</span>;
|
||||||
}
|
}
|
||||||
|
|
||||||
renderRequired(isRequired) {
|
|
||||||
if (!isRequired) {
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
return <span className='text-primary'><strong>*</strong></span>;
|
|
||||||
}
|
|
||||||
|
|
||||||
renderComingSoon(isComingSoon) {
|
renderComingSoon(isComingSoon) {
|
||||||
if (!isComingSoon) {
|
if (!isComingSoon) {
|
||||||
return null;
|
return null;
|
||||||
@ -85,14 +75,13 @@ export class Challenge extends PureComponent {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
renderLocked(title, isRequired, isComingSoon, className) {
|
renderLocked(title, isComingSoon, className) {
|
||||||
return (
|
return (
|
||||||
<p
|
<p
|
||||||
className={ className }
|
className={ className }
|
||||||
key={ title }
|
key={ title }
|
||||||
>
|
>
|
||||||
{ title }
|
{ title }
|
||||||
{ this.renderRequired(isRequired) }
|
|
||||||
{ this.renderComingSoon(isComingSoon) }
|
{ this.renderComingSoon(isComingSoon) }
|
||||||
</p>
|
</p>
|
||||||
);
|
);
|
||||||
@ -108,7 +97,6 @@ export class Challenge extends PureComponent {
|
|||||||
isCompleted,
|
isCompleted,
|
||||||
isDev,
|
isDev,
|
||||||
isLocked,
|
isLocked,
|
||||||
isRequired,
|
|
||||||
title
|
title
|
||||||
} = this.props;
|
} = this.props;
|
||||||
if (!title) {
|
if (!title) {
|
||||||
@ -126,7 +114,6 @@ export class Challenge extends PureComponent {
|
|||||||
if (isLocked || (!isDev && isComingSoon)) {
|
if (isLocked || (!isDev && isComingSoon)) {
|
||||||
return this.renderLocked(
|
return this.renderLocked(
|
||||||
title,
|
title,
|
||||||
isRequired,
|
|
||||||
isComingSoon,
|
isComingSoon,
|
||||||
challengeClassName
|
challengeClassName
|
||||||
);
|
);
|
||||||
@ -143,7 +130,6 @@ export class Challenge extends PureComponent {
|
|||||||
<span >
|
<span >
|
||||||
{ title }
|
{ title }
|
||||||
{ this.renderCompleted(isCompleted, isLocked) }
|
{ this.renderCompleted(isCompleted, isLocked) }
|
||||||
{ this.renderRequired(isRequired) }
|
|
||||||
</span>
|
</span>
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
|
Reference in New Issue
Block a user