Skip to content

Commit c803b7b

Browse files
fix: remove trailing hr from ChallengeDescription (freeCodeCamp#56749)
Co-authored-by: moT01 <[email protected]>
1 parent edebaef commit c803b7b

File tree

5 files changed

+15
-25
lines changed

5 files changed

+15
-25
lines changed

client/src/templates/Challenges/classic/show.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -392,10 +392,8 @@ function ShowClassic({
392392
block={block}
393393
challengeDescription={
394394
<ChallengeDescription
395-
block={block}
396395
description={description}
397396
instructions={instructions}
398-
superBlock={superBlock}
399397
/>
400398
}
401399
challengeTitle={

client/src/templates/Challenges/components/challenge-description.tsx

Lines changed: 11 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,33 +3,21 @@ import React from 'react';
33
import PrismFormatted from './prism-formatted';
44
import './challenge-description.css';
55

6-
type Challenge = {
7-
block?: string;
6+
type Props = {
87
description?: string;
98
instructions?: string;
10-
superBlock?: string;
119
};
1210

13-
function ChallengeDescription(challenge: Challenge): JSX.Element {
14-
const sbClass = challenge.superBlock ? challenge.superBlock : '';
15-
const bClass = challenge.block ? challenge.block : '';
16-
17-
return (
18-
<div
19-
className={`challenge-instructions ${sbClass} ${bClass}`}
20-
data-playwright-test-label='challenge-description'
21-
>
22-
{challenge.description && <PrismFormatted text={challenge.description} />}
23-
{challenge.instructions && (
24-
<>
25-
<hr />
26-
<PrismFormatted text={challenge.instructions} />
27-
</>
28-
)}
29-
<hr />
30-
</div>
31-
);
32-
}
11+
const ChallengeDescription = ({ description, instructions }: Props) => (
12+
<div
13+
className={'challenge-instructions'}
14+
data-playwright-test-label='challenge-description'
15+
>
16+
{description && <PrismFormatted text={description} />}
17+
{instructions && description && <hr />}
18+
{instructions && <PrismFormatted text={instructions} />}
19+
</div>
20+
);
3321

3422
ChallengeDescription.displayName = 'ChallengeDescription';
3523

client/src/templates/Challenges/components/side-panel.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { SuperBlocks } from '../../../../../shared/config/curriculum';
88
import { initializeMathJax } from '../../../utils/math-jax';
99
import { challengeTestsSelector } from '../redux/selectors';
1010
import { openModal } from '../redux/actions';
11+
import { Spacer } from '../../../components/helpers';
1112
import TestSuite from './test-suite';
1213

1314
import './side-panel.css';
@@ -83,6 +84,7 @@ export function SidePanel({
8384
</p>
8485
)}
8586
{challengeDescription}
87+
<Spacer size='medium' />
8688
{toolPanel}
8789
<TestSuite tests={tests} />
8890
</div>

client/src/templates/Challenges/projects/backend/show.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,7 @@ class BackEnd extends Component<BackEndProps> {
242242
description={description}
243243
instructions={instructions}
244244
/>
245+
<Spacer size='medium' />
245246
<SolutionForm
246247
challengeType={challengeType}
247248
// eslint-disable-next-line @typescript-eslint/unbound-method

client/src/templates/Challenges/projects/frontend/show.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ class Project extends Component<ProjectProps> {
197197
description={description}
198198
instructions={instructions}
199199
/>
200+
<Spacer size='medium' />
200201
<SolutionForm
201202
challengeType={challengeType}
202203
description={description}

0 commit comments

Comments
 (0)