Merge pull request #135 from Bouncey/fix/introCheckMark

Remove check mark against intro pages
This commit is contained in:
mrugesh mohapatra
2018-06-02 02:26:48 +05:30
committed by Mrugesh Mohapatra
parent 910dd0584c
commit 9f8731ee51
2 changed files with 11 additions and 17 deletions

View File

@ -75,10 +75,18 @@ export class Block extends PureComponent {
};
}
renderCheckMark(isCompleted) {
return isCompleted ? (
<GreenPass style={mapIconStyle} />
) : (
<GreenNotCompleted style={mapIconStyle} />
);
}
renderChallenges(intro = {}, challenges = []) {
// TODO: Split this into a Challenge Component and add tests
// TODO: The styles badge and map-badge on the completion span do not exist
return [intro].concat(challenges).map(challenge => {
return [intro].concat(challenges).map((challenge, i) => {
const completedClass = challenge.isCompleted
? ' map-challenge-title-completed'
: '';
@ -88,11 +96,7 @@ export class Block extends PureComponent {
key={'map-challenge' + challenge.fields.slug}
>
<span className='badge map-badge'>
{challenge.isCompleted ? (
<GreenPass style={mapIconStyle} />
) : (
<GreenNotCompleted style={mapIconStyle} />
)}
{i !== 0 && this.renderCheckMark(challenge.isCompleted)}
</span>
<Link
onClick={this.handleChallengeClick(challenge.fields.slug)}

View File

@ -36,17 +36,7 @@ exports[`<Block expanded snapshot: block-expanded 1`] = `
>
<span
className="badge map-badge"
>
<GreenNotCompleted
style={
Object {
"height": "15px",
"marginRight": "10px",
"width": "15px",
}
}
/>
</span>
/>
<Unknown
onClick={[Function]}
to="/super-block-one/block-a"