Skip to content

Commit 660152e

Browse files
committed
Fix uncontroversial spacing warnings
1 parent bef7468 commit 660152e

File tree

73 files changed

+830
-783
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+830
-783
lines changed

src/app/components/content/IsaacCallout.tsx

Lines changed: 33 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -6,36 +6,36 @@ import classNames from "classnames";
66
import {siteSpecific} from "../../services";
77

88
const calloutStyle = siteSpecific({
9-
width: "43",
10-
height: "43",
11-
// SVG taken from https://www.svgrepo.com/svg/914/speech-bubble, no attribution needed
12-
src: "/assets/phy/callout-speech-bubble.svg",
13-
style: {
14-
marginTop: -7,
15-
marginLeft: -2,
16-
marginRight: 18
17-
},
18-
colour: "t-grey"
19-
},{
20-
width: "50",
21-
height: "50",
22-
src: {
23-
regular: "/assets/cs/icons/regular-callout.svg",
24-
testData: "/assets/cs/icons/test-callout.svg",
25-
sampleRun: "/assets/cs/icons/run-callout.svg",
26-
scenario: "/assets/cs/icons/scenario-callout.svg",
27-
},
28-
style: {
29-
marginTop: -15,
30-
marginRight: -15
31-
},
32-
colour: {
33-
regular: "hi-cyan-25",
34-
testData: "hi-yellow-25",
35-
sampleRun: "hi-pink-25",
36-
scenario: "hi-yellow-50",
37-
}
38-
});
9+
width: "43",
10+
height: "43",
11+
// SVG taken from https://www.svgrepo.com/svg/914/speech-bubble, no attribution needed
12+
src: "/assets/phy/callout-speech-bubble.svg",
13+
style: {
14+
marginTop: -7,
15+
marginLeft: -2,
16+
marginRight: 18
17+
},
18+
colour: "t-grey"
19+
},{
20+
width: "50",
21+
height: "50",
22+
src: {
23+
regular: "/assets/cs/icons/regular-callout.svg",
24+
testData: "/assets/cs/icons/test-callout.svg",
25+
sampleRun: "/assets/cs/icons/run-callout.svg",
26+
scenario: "/assets/cs/icons/scenario-callout.svg",
27+
},
28+
style: {
29+
marginTop: -15,
30+
marginRight: -15
31+
},
32+
colour: {
33+
regular: "hi-cyan-25",
34+
testData: "hi-yellow-25",
35+
sampleRun: "hi-pink-25",
36+
scenario: "hi-yellow-50",
37+
}
38+
});
3939

4040
const DEFAULT_CALLOUT_STYLE = "regular" as const;
4141
export const IsaacCallout = ({doc}: {doc: ContentDTO}) => {
@@ -49,10 +49,11 @@ export const IsaacCallout = ({doc}: {doc: ContentDTO}) => {
4949
className={classNames("isaac-callout", colourClass)}>
5050
<Col>
5151
<img className={siteSpecific("float-start", "float-end")} style={calloutStyle.style}
52-
width={calloutStyle.width} height={calloutStyle.height} src={iconSrc} alt=""/>
52+
width={calloutStyle.width} height={calloutStyle.height} src={iconSrc} alt=""
53+
/>
5354
<IsaacContentValueOrChildren encoding={doc.encoding} value={doc.value}>
5455
{doc.children}
5556
</IsaacContentValueOrChildren>
5657
</Col>
5758
</Row>;
58-
};
59+
};

src/app/components/content/IsaacCodeSnippet.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@ const IsaacCodeSnippet = ({doc}: IsaacCodeProps) => {
4545
{isAda && window.ResizeObserver && <ScrollShadows element={scrollPromptRef} />}
4646
<Row>
4747
<Col>
48-
<pre ref={updateScrollPromptRef} className="line-numbers">
49-
<code ref={codeSnippetRef} className={doc.disableHighlighting ? 'plaintext' : doc.language}>
50-
{doc.code}
51-
</code>
52-
</pre>
48+
<pre ref={updateScrollPromptRef} className="line-numbers">
49+
<code ref={codeSnippetRef} className={doc.disableHighlighting ? 'plaintext' : doc.language}>
50+
{doc.code}
51+
</code>
52+
</pre>
5353
</Col>
5454
</Row>
5555
</div>

src/app/components/content/IsaacContentValueOrChildren.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,5 +70,5 @@ export const IsaacContentValueOrChildren = ({value, encoding, children}: Content
7070
</div>;
7171
}
7272
})}
73-
</React.Fragment>;
73+
</React.Fragment>;
7474
};

src/app/components/content/IsaacGraphSketcherQuestion.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ const IsaacGraphSketcherQuestion = ({doc, questionId, readonly}: IsaacQuestionPr
9292
</IsaacContentValueOrChildren>
9393
</div>
9494
<div className="sketch-preview d-flex justify-content-center overflow-auto" onClick={openModal} onKeyUp={openModal} role={readonly ? undefined : "button"}
95-
tabIndex={readonly ? undefined : 0}>
95+
tabIndex={readonly ? undefined : 0}
96+
>
9697
<div ref={previewRef} className={`${questionId}-graph-sketcher-preview`} />
9798
</div>
9899
{modalVisible && <GraphSketcherModal
@@ -107,4 +108,4 @@ const IsaacGraphSketcherQuestion = ({doc, questionId, readonly}: IsaacQuestionPr
107108
</div>
108109
</div>;
109110
};
110-
export default IsaacGraphSketcherQuestion;
111+
export default IsaacGraphSketcherQuestion;

src/app/components/content/IsaacHints.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,10 @@ export const IsaacLinkHints = ({hints, questionPartId}: HintsProps) => {
2929
{
3030
hints?.map((hint, index) =>
3131
<Col key={index} xs={{size: 3}} lg={{size: 2}}>
32-
<IsaacHintModal questionPartId={questionPartId} hintIndex={index}
33-
label={`Hint ${index + 1}`} title={hint.title || `Hint ${index + 1}`}
34-
body={hint} scrollable />
32+
<IsaacHintModal questionPartId={questionPartId} hintIndex={index}
33+
label={`Hint ${index + 1}`} title={hint.title || `Hint ${index + 1}`}
34+
body={hint} scrollable
35+
/>
3536
</Col>
3637
)
3738
}

src/app/components/content/IsaacParsonsQuestion.tsx

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -315,27 +315,27 @@ const IsaacParsonsQuestion = ({doc, questionId, readonly} : IsaacQuestionProps<I
315315
{...provided.dragHandleProps}
316316
style={getStyle(provided.draggableProps.style, snapshot)}
317317
>
318-
<pre>
319-
{item.value}
320-
{canIndent && <div className="controls">
321-
{/* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */}
322-
<span
323-
className={`reduce ${canDecreaseIndentation ? 'show' : 'hide' }`}
324-
role="img" onMouseUp={() => reduceIndentation(index)}
325-
aria-label={`reduce indentation ${!canDecreaseIndentation ? "(disabled)" : ""}`}
326-
>
318+
<pre>
319+
{item.value}
320+
{canIndent && <div className="controls">
321+
{/* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */}
322+
<span
323+
className={`reduce ${canDecreaseIndentation ? 'show' : 'hide' }`}
324+
role="img" onMouseUp={() => reduceIndentation(index)}
325+
aria-label={`reduce indentation ${!canDecreaseIndentation ? "(disabled)" : ""}`}
326+
>
327327
&nbsp;
328-
</span>
329-
{/* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */}
330-
<span
331-
className={`increase ${canIncreaseIndentation ? 'show' : 'hide' }`}
332-
role="img" onMouseUp={() => increaseIndentation(index)}
333-
aria-label={`increase indentation ${!canIncreaseIndentation ? "(disabled)" : ""}`}
334-
>
328+
</span>
329+
{/* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */}
330+
<span
331+
className={`increase ${canIncreaseIndentation ? 'show' : 'hide' }`}
332+
role="img" onMouseUp={() => increaseIndentation(index)}
333+
aria-label={`increase indentation ${!canIncreaseIndentation ? "(disabled)" : ""}`}
334+
>
335335
&nbsp;
336-
</span>
337-
</div>}
338-
</pre>
336+
</span>
337+
</div>}
338+
</pre>
339339
</div>;
340340
}}
341341
</Draggable>;

src/app/components/content/IsaacQuickQuestion.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,10 @@ export const IsaacQuickQuestion = ({doc}: {doc: IsaacQuickQuestionDTO}) => {
6969
};
7070
return <>
7171
<ConfidenceQuestions state={confidenceState} setState={setConfidenceState}
72-
validationPending={validationPending} setValidationPending={setValidationPending}
73-
disableInitialState={confidenceDisabled}
74-
identifier={doc.id} type={"quick_question"} />
72+
validationPending={validationPending} setValidationPending={setValidationPending}
73+
disableInitialState={confidenceDisabled}
74+
identifier={doc.id} type={"quick_question"}
75+
/>
7576
{isVisible && <Row className="mt-3 no-print">
7677
<Col sm={12} md={!fastTrackInfo.isFastTrackPage ? siteSpecific({size: 10, offset: 1}, {size: 12}) : {}}>
7778
<Button color="secondary" type={"button"} block className={classNames("active", {"hide-answer": isAda})} onClick={hideAnswer}>

src/app/components/content/IsaacReorderQuestion.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,8 @@ const IsaacReorderQuestion = ({doc, questionId, readonly} : IsaacQuestionProps<I
136136
<Droppable droppableId="availableItems">
137137
{(provided, snapshot) =>
138138
<div ref={provided.innerRef}
139-
className={classNames("parsons-items", {"empty": !(availableItems && availableItems.length > 0), "drag-over": snapshot.isDraggingOver})}>
139+
className={classNames("parsons-items", {"empty": !(availableItems && availableItems.length > 0), "drag-over": snapshot.isDraggingOver})}
140+
>
140141
{availableItems && availableItems.map((item, index) =>
141142
<ReorderDraggableItem key={item.id} item={item} index={index} inAvailableItems readonly={readonly}/>)}
142143
{(!availableItems || availableItems.length === 0)
@@ -151,7 +152,8 @@ const IsaacReorderQuestion = ({doc, questionId, readonly} : IsaacQuestionProps<I
151152
<Droppable droppableId="answerItems">
152153
{(provided, snapshot) =>
153154
<div id="parsons-choice-area" ref={provided.innerRef}
154-
className={classNames("parsons-items", {"empty": !(currentAttempt && currentAttempt.items && currentAttempt.items.length > 0), "drag-over": snapshot.isDraggingOver})}>
155+
className={classNames("parsons-items", {"empty": !(currentAttempt && currentAttempt.items && currentAttempt.items.length > 0), "drag-over": snapshot.isDraggingOver})}
156+
>
155157
{currentAttempt && currentAttempt.items && currentAttempt.items.map((item, index) =>
156158
<ReorderDraggableItem key={item.id} item={item} index={index} readonly={readonly}/>)}
157159
{(!currentAttempt || currentAttempt?.items?.length === 0)

src/app/components/elements/Accordion.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ export const Accordion = withRouter(({id, trustedTitle, index, children, startOp
184184
<div className="accordion-title ps-3">
185185
<RS.Row className="h-100">
186186
<div className="d-flex align-items-center p-0 h-100">
187-
{/* FIXME Revisit this maybe? https://github.com/isaacphysics/isaac-react-app/pull/473#discussion_r841556455 */}
187+
{/* FIXME Revisit this maybe? https://github.com/isaacphysics/isaac-react-app/pull/473#discussion_r841556455 */}
188188
<span className="accordion-part p-3 text-secondary text-nowrap">Part {ALPHABET[(index as number) % ALPHABET.length]} {" "}</span>
189189
{trustedTitle && <div className="p-3">
190190
<h2>
@@ -196,7 +196,7 @@ export const Accordion = withRouter(({id, trustedTitle, index, children, startOp
196196
{typeof disabled === "string" && disabled.length > 0 && <div className={"p-3"}>
197197
<span id={`disabled-tooltip-${componentId}`} className="icon-help" />
198198
<RS.UncontrolledTooltip placement="right" target={`disabled-tooltip-${componentId}`}
199-
modifiers={[preventOverflow]}>
199+
modifiers={[preventOverflow]}>
200200
{disabled}
201201
</RS.UncontrolledTooltip>
202202
</div>}

src/app/components/elements/AccountTypeMessage.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@ import {UserRole} from "../../../IsaacApiTypes";
66

77
export const AccountTypeMessage = ({role, hideUpgradeMessage}: { role?: UserRole, hideUpgradeMessage?: boolean }) => {
88
return <div>
9-
{role && <>
9+
{role && <>
1010
You have a <strong>{UserFacingRole[role]}</strong> account.
11-
{role === "STUDENT" && !hideUpgradeMessage &&
11+
{role === "STUDENT" && !hideUpgradeMessage &&
1212
<span> If you are a teacher{siteSpecific(" or tutor", "")}, you can {" "}
1313
{siteSpecific(
1414
<Link to={TEACHER_REQUEST_ROUTE} target="_blank">upgrade your account</Link>,
1515
<strong><Link to={TEACHER_REQUEST_ROUTE} target="_blank">upgrade your account</Link></strong>
1616
)}
1717
{"."}
1818
</span>
19+
}
20+
</>
1921
}
20-
</>
21-
}
2222
</div>;
2323
};

src/app/components/elements/Assignments.tsx

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -125,24 +125,24 @@ const PhyAssignmentCard = ({assignment}: {assignment: AssignmentDTO}) => {
125125
{boardStagesAndDifficulties.length > 0 && <p className="mb-0">
126126
<table className="w-100">
127127
<thead>
128-
<tr>
129-
<th className="w-50">
130-
{`Stage${boardStagesAndDifficulties.length > 1 ? "s" : ""}:`}
131-
</th>
132-
<th className="w-50">
133-
{`Difficult${boardStagesAndDifficulties.some(([, ds]) => ds.length > 1) ? "ies" : "y"}`}
134-
</th>
135-
</tr>
128+
<tr>
129+
<th className="w-50">
130+
{`Stage${boardStagesAndDifficulties.length > 1 ? "s" : ""}:`}
131+
</th>
132+
<th className="w-50">
133+
{`Difficult${boardStagesAndDifficulties.some(([, ds]) => ds.length > 1) ? "ies" : "y"}`}
134+
</th>
135+
</tr>
136136
</thead>
137137
<tbody>
138-
{boardStagesAndDifficulties.map(([stage, difficulties]) => <tr key={stage}>
139-
<td className="w-50 align-baseline">
140-
{stageLabelMap[stage]}:
141-
</td>
142-
<td className="w-50 ps-1">
143-
{difficulties.map((d) => difficultyShortLabelMap[d]).join(", ")}
144-
</td>
145-
</tr>)}
138+
{boardStagesAndDifficulties.map(([stage, difficulties]) => <tr key={stage}>
139+
<td className="w-50 align-baseline">
140+
{stageLabelMap[stage]}:
141+
</td>
142+
<td className="w-50 ps-1">
143+
{difficulties.map((d) => difficultyShortLabelMap[d]).join(", ")}
144+
</td>
145+
</tr>)}
146146
</tbody>
147147
</table>
148148
</p>}

src/app/components/elements/FastTrackProgress.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ export function FastTrackProgress({doc, search}: {doc: IsaacFastTrackQuestionPag
329329
<Hexagon
330330
{...hexagon} properties={hexagon.questionPartProgress}
331331
states={question.questionPartStates} selector={state => state === "CORRECT"}
332-
/>
332+
/>
333333
{question.isCompleted ?
334334
generateCompletionTick(question.isCurrentQuestion) :
335335
generateHexagonTitle(question.hexagonTitle, question.isCurrentQuestion)}

0 commit comments

Comments
 (0)