fix(Side-Panel): Revert changes to renderDescription
This commit is contained in:
@ -30,6 +30,13 @@ import { descriptionRegex } from './utils';
|
|||||||
import { challengeSelector } from '../../redux';
|
import { challengeSelector } from '../../redux';
|
||||||
import { makeToast } from '../../Toasts/redux';
|
import { makeToast } from '../../Toasts/redux';
|
||||||
|
|
||||||
|
const mapDispatchToProps = {
|
||||||
|
makeToast,
|
||||||
|
executeChallenge,
|
||||||
|
updateHint,
|
||||||
|
openHelpModal,
|
||||||
|
unlockUntrustedCode
|
||||||
|
};
|
||||||
const mapStateToProps = createSelector(
|
const mapStateToProps = createSelector(
|
||||||
challengeSelector,
|
challengeSelector,
|
||||||
challengeMetaSelector,
|
challengeMetaSelector,
|
||||||
@ -55,15 +62,6 @@ const mapStateToProps = createSelector(
|
|||||||
isCodeLocked
|
isCodeLocked
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
const mapDispatchToProps = {
|
|
||||||
makeToast,
|
|
||||||
executeChallenge,
|
|
||||||
updateHint,
|
|
||||||
openHelpModal,
|
|
||||||
unlockUntrustedCode
|
|
||||||
};
|
|
||||||
|
|
||||||
const propTypes = {
|
const propTypes = {
|
||||||
description: PropTypes.arrayOf(PropTypes.string),
|
description: PropTypes.arrayOf(PropTypes.string),
|
||||||
executeChallenge: PropTypes.func,
|
executeChallenge: PropTypes.func,
|
||||||
@ -97,8 +95,7 @@ export class SidePanel extends PureComponent {
|
|||||||
this.descriptionTop = node;
|
this.descriptionTop = node;
|
||||||
}
|
}
|
||||||
|
|
||||||
renderDescription() {
|
renderDescription(description = [ 'Happy Coding!' ]) {
|
||||||
const { description = [ 'Happy Coding!' ] } = this.props;
|
|
||||||
return description.map((line, index) => {
|
return description.map((line, index) => {
|
||||||
if (descriptionRegex.test(line)) {
|
if (descriptionRegex.test(line)) {
|
||||||
return (
|
return (
|
||||||
@ -121,6 +118,7 @@ export class SidePanel extends PureComponent {
|
|||||||
render() {
|
render() {
|
||||||
const {
|
const {
|
||||||
title,
|
title,
|
||||||
|
description,
|
||||||
tests = [],
|
tests = [],
|
||||||
output,
|
output,
|
||||||
hint,
|
hint,
|
||||||
@ -144,7 +142,7 @@ export class SidePanel extends PureComponent {
|
|||||||
{ title }
|
{ title }
|
||||||
</ChallengeTitle>
|
</ChallengeTitle>
|
||||||
<ChallengeDescription>
|
<ChallengeDescription>
|
||||||
{ this.renderDescription() }
|
{ this.renderDescription(description) }
|
||||||
</ChallengeDescription>
|
</ChallengeDescription>
|
||||||
</div>
|
</div>
|
||||||
<ToolPanel
|
<ToolPanel
|
||||||
|
Reference in New Issue
Block a user