Skip to content

Commit 9276df4

Browse files
fix(client): spacing issues in quiz challenge (freeCodeCamp#56805)
1 parent 4f74e50 commit 9276df4

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed

client/src/templates/Challenges/quiz/show.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
}
66

77
/* Override the bottom margin set in global.css */
8-
.quiz-challenge-container .quiz-answer-label p:last-child {
8+
.quiz-challenge-container .quiz-answer-label p:last-child,
9+
.quiz-challenge-container div[role='radiogroup'] label p:last-child {
910
margin-bottom: 0;
1011
}

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

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,18 @@ import { connect } from 'react-redux';
77
import { bindActionCreators } from 'redux';
88
import type { Dispatch } from 'redux';
99
import { createSelector } from 'reselect';
10-
import { Container, Col, Row, Button, Quiz, useQuiz } from '@freecodecamp/ui';
10+
import {
11+
Container,
12+
Col,
13+
Row,
14+
Button,
15+
Quiz,
16+
useQuiz,
17+
Spacer
18+
} from '@freecodecamp/ui';
1119

1220
// Local Utilities
1321
import { shuffleArray } from '../../../../../shared/utils/shuffle-array';
14-
import Spacer from '../../../components/helpers/spacer';
1522
import LearnLayout from '../../../components/layouts/learn';
1623
import { ChallengeNode, ChallengeMeta, Test } from '../../../redux/prop-types';
1724
// import { challengeTypes } from '../../../../../shared/config/challenge-types';
@@ -228,7 +235,7 @@ const ShowQuiz = ({
228235
/>
229236
<Container className='quiz-challenge-container'>
230237
<Row>
231-
<Spacer size='medium' />
238+
<Spacer size='m' />
232239
<ChallengeTitle
233240
isCompleted={isChallengeCompleted}
234241
translationPending={translationPending}
@@ -237,15 +244,17 @@ const ShowQuiz = ({
237244
</ChallengeTitle>
238245

239246
<Col md={8} mdOffset={2} sm={10} smOffset={1} xs={12}>
247+
<Spacer size='m' />
240248
<ChallengeDescription description={description} />
249+
<Spacer size='l' />
241250
<ObserveKeys>
242251
<Quiz questions={quizData} disabled={hasSubmitted} />
243252
</ObserveKeys>
244-
<Spacer size='medium' />
253+
<Spacer size='m' />
245254
<div aria-live='polite' aria-atomic='true'>
246255
{errorMessage}
247256
</div>
248-
<Spacer size='medium' />
257+
<Spacer size='m' />
249258
{/*
250259
There are three cases for the button display:
251260
1. Campers submit the answers but don't pass
@@ -273,7 +282,7 @@ const ShowQuiz = ({
273282
{t('buttons.submit-and-go')}
274283
</Button>
275284
)}
276-
<Spacer size='large' />
285+
<Spacer size='l' />
277286
</Col>
278287
<CompletionModal />
279288
</Row>

0 commit comments

Comments
 (0)