Skip to content

Commit 0cf9d3f

Browse files
committed
Make RS imports consistent
1 parent dd99d6d commit 0cf9d3f

Some content is hidden

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

53 files changed

+1036
-1048
lines changed

src/app/components/content/IsaacQuestion.tsx

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import {
1010
import {IsaacContent} from "./IsaacContent";
1111
import * as ApiTypes from "../../../IsaacApiTypes";
1212
import {ContentDTO} from "../../../IsaacApiTypes";
13-
import * as RS from "reactstrap";
1413
import {
1514
below,
1615
determineFastTrackPrimaryAction,
@@ -35,6 +34,7 @@ import { submitInlineRegion, useInlineRegionPart } from "./IsaacInlineRegion";
3534
import LLMFreeTextQuestionFeedbackView from "../elements/LLMFreeTextQuestionFeedbackView";
3635
import { LLMFreeTextQuestionRemainingAttemptsView } from "../elements/LLMFreeTextQuestionRemainingAttemptsView";
3736
import { skipToken } from "@reduxjs/toolkit/query";
37+
import { Alert, Button, Col, Form, Row } from "reactstrap";
3838

3939
function useCanAttemptQuestionType(questionType?: string): ReturnType<typeof useCanAttemptQuestionTypeQuery> {
4040
// We skip the check with the API if the question type is not a restricted question type
@@ -169,7 +169,7 @@ export const IsaacQuestion = withRouter(({doc, location}: {doc: ApiTypes.Questio
169169
<IsaacContent doc={validationResponse?.explanation as ContentDTO}/>;
170170

171171
return <ConfidenceContext.Provider value={{recordConfidence}}>
172-
<RS.Form onSubmit={(event) => {
172+
<Form onSubmit={(event) => {
173173
if (event) {event.preventDefault();}
174174
submitCurrentAttempt(questionPart, doc.id as string, doc.type as string, currentGameboard, currentUser, dispatch);
175175
setHasSubmitted(true);
@@ -195,13 +195,13 @@ export const IsaacQuestion = withRouter(({doc, location}: {doc: ApiTypes.Questio
195195
}
196196

197197
{/* CS Hint Reminder */}
198-
{isAda && (!validationResponse || !correct || canSubmit) && <RS.Row>
199-
<RS.Col xl={{size: 10}} >
198+
{isAda && (!validationResponse || !correct || canSubmit) && <Row>
199+
<Col xl={{size: 10}} >
200200
{doc.hints && !!doc.hints.length && <p className="no-print mb-0">
201201
<small>{"Don't forget to use the hints if you need help."}</small>
202202
</p>}
203-
</RS.Col>
204-
</RS.Row>}
203+
</Col>
204+
</Row>}
205205

206206
{/* CS Hints */}
207207
{isAda && <IsaacLinkHints questionPartId={doc.id as string} hints={doc.hints} />}
@@ -226,21 +226,21 @@ export const IsaacQuestion = withRouter(({doc, location}: {doc: ApiTypes.Questio
226226
<span>You can view feedback for a specific box by either selecting it above, or by using the control panel below.</span>
227227
<div className={`feedback-panel-${almost ? "light" : "dark"}`} role="note" aria-labelledby="answer-feedback">
228228
<div className={`w-100 mt-2 d-flex feedback-panel-header justify-content-around`}>
229-
<RS.Button color="transparent" onClick={() => {
229+
<Button color="transparent" onClick={() => {
230230
inlineContext.setFeedbackIndex(((inlineContext?.feedbackIndex as number - 1) + numInlineQuestions) % numInlineQuestions);
231231
}}>
232232
{below["xs"](deviceSize) ? "◀" : "Previous" }
233-
</RS.Button>
234-
<RS.Button color="transparent" className="inline-part-jump align-self-center" onClick={() => {
233+
</Button>
234+
<Button color="transparent" className="inline-part-jump align-self-center" onClick={() => {
235235
if (inlineContext.feedbackIndex) inlineContext.setFocusSelection(true);
236236
}}>
237237
Box {inlineContext.feedbackIndex as number + 1} of {numInlineQuestions}
238-
</RS.Button>
239-
<RS.Button color="transparent" onClick={() => {
238+
</Button>
239+
<Button color="transparent" onClick={() => {
240240
inlineContext.setFeedbackIndex((inlineContext?.feedbackIndex as number + 1) % numInlineQuestions);
241241
}}>
242242
{below["xs"](deviceSize) ? "▶" : "Next"}
243-
</RS.Button>
243+
</Button>
244244
</div>
245245
<div className="feedback-panel-content p-3">
246246
{validationFeedback}
@@ -251,9 +251,9 @@ export const IsaacQuestion = withRouter(({doc, location}: {doc: ApiTypes.Questio
251251
</div>}
252252

253253
{/* Lock */}
254-
{locked && <RS.Alert color="danger" className={"no-print"}>
254+
{locked && <Alert color="danger" className={"no-print"}>
255255
This question is locked until at least {<DateString formatter={TIME_ONLY}>{locked}</DateString>} to prevent repeated guessing.
256-
</RS.Alert>}
256+
</Alert>}
257257

258258
{/* Action Buttons */}
259259
{recordConfidence ?
@@ -286,7 +286,7 @@ export const IsaacQuestion = withRouter(({doc, location}: {doc: ApiTypes.Questio
286286
<IsaacTabbedHints questionPartId={doc.id as string} hints={doc.hints} />
287287
</div>}
288288
</div>
289-
</RS.Form>
289+
</Form>
290290

291291
{/* LLM free-text question validation response */}
292292
{isLLMFreeTextQuestion && showQuestionFeedback && validationResponse && showInlineAttemptStatus && !canSubmit &&

src/app/components/content/IsaacSymbolicQuestion.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import React, {ChangeEvent, lazy, Suspense, useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState} from "react";
2-
import * as RS from "reactstrap";
32
import {IsaacContentValueOrChildren} from "./IsaacContentValueOrChildren";
43
import {FormulaDTO, IsaacSymbolicQuestionDTO} from "../../../IsaacApiTypes";
54
import katex from "katex";
@@ -18,6 +17,7 @@ import {v4 as uuid_v4} from "uuid";
1817
import {IsaacQuestionProps} from "../../../IsaacAppTypes";
1918
import classNames from "classnames";
2019
import QuestionInputValidation from "../elements/inputs/QuestionInputValidation";
20+
import { InputGroup, Input, Button, UncontrolledTooltip } from "reactstrap";
2121

2222
const InequalityModal = lazy(() => import("../elements/modals/inequality/InequalityModal"));
2323

@@ -237,15 +237,15 @@ const IsaacSymbolicQuestion = ({doc, questionId, readonly}: IsaacQuestionProps<I
237237
</Suspense>}
238238
{!readonly && <div className="eqn-editor-input">
239239
<div ref={hiddenEditorRef} className="equation-editor-text-entry" style={{height: 0, overflow: "hidden", visibility: "hidden"}} />
240-
<RS.InputGroup className="my-2 separate-input-group">
241-
<RS.Input type="text" onChange={updateEquation} value={textInput}
240+
<InputGroup className="my-2 separate-input-group">
241+
<Input type="text" onChange={updateEquation} value={textInput}
242242
placeholder="Type your formula here"/>
243243
<>
244244
{siteSpecific(
245-
<RS.Button type="button" className="eqn-editor-help" id={helpTooltipId} tag="a" href="/solving_problems#symbolic_text">?</RS.Button>,
245+
<Button type="button" className="eqn-editor-help" id={helpTooltipId} tag="a" href="/solving_problems#symbolic_text">?</Button>,
246246
<span id={helpTooltipId} className="icon-help-q my-auto"/>
247247
)}
248-
{<RS.UncontrolledTooltip placement="top" autohide={false} target={helpTooltipId}>
248+
{<UncontrolledTooltip placement="top" autohide={false} target={helpTooltipId}>
249249
Here are some examples of expressions you can type:<br />
250250
<br />
251251
a*x^2 + b x + c<br />
@@ -254,9 +254,9 @@ const IsaacSymbolicQuestion = ({doc, questionId, readonly}: IsaacQuestionProps<I
254254
log(x_a, 2) == log(x_a) / log(2)<br />
255255
<br />
256256
As you type, the box below will preview the result.
257-
</RS.UncontrolledTooltip>}
257+
</UncontrolledTooltip>}
258258
</>
259-
</RS.InputGroup>
259+
</InputGroup>
260260
<QuestionInputValidation userInput={textInput} validator={symbolicInputValidator} />
261261
{symbolList && <div className="eqn-editor-symbols">
262262
The following symbols may be useful: <pre>{symbolList}</pre>

src/app/components/elements/Accordion.tsx

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import React, {useEffect, useRef, useState} from "react";
2-
import * as RS from "reactstrap";
32
import {RouteComponentProps, withRouter} from "react-router-dom";
43
import {
54
above,
@@ -23,6 +22,7 @@ import {Markup} from "./markup";
2322
import {ReportAccordionButton} from "./ReportAccordionButton";
2423
import preventOverflow from '@popperjs/core/lib/modifiers/preventOverflow.js';
2524
import debounce from "lodash/debounce";
25+
import { Button, Row, UncontrolledTooltip, Collapse, Card, CardBody } from "reactstrap";
2626

2727
interface AccordionsProps extends RouteComponentProps {
2828
id?: string;
@@ -148,7 +148,7 @@ export const Accordion = withRouter(({id, trustedTitle, index, children, startOp
148148

149149
return <div className="accordion">
150150
<div className="accordion-header">
151-
<RS.Button
151+
<Button
152152
id={anchorId || ""} block color="link"
153153
tabIndex={disabled ? -1 : 0}
154154
onFocus={(e) => {
@@ -184,7 +184,7 @@ export const Accordion = withRouter(({id, trustedTitle, index, children, startOp
184184
)}
185185
</span>}
186186
<div className="accordion-title ps-3">
187-
<RS.Row className="h-100">
187+
<Row className="h-100">
188188
<div className="d-flex align-items-center p-0 h-100">
189189
{/* FIXME Revisit this maybe? https://github.com/isaacphysics/isaac-react-app/pull/473#discussion_r841556455 */}
190190
<span className="accordion-part p-3 text-secondary text-nowrap">Part {ALPHABET[(index as number) % ALPHABET.length]} {" "}</span>
@@ -197,29 +197,29 @@ export const Accordion = withRouter(({id, trustedTitle, index, children, startOp
197197
</div>}
198198
{typeof disabled === "string" && disabled.length > 0 && <div className={"p-3"}>
199199
<span id={`disabled-tooltip-${componentId}`} className="icon-help" />
200-
<RS.UncontrolledTooltip placement="right" target={`disabled-tooltip-${componentId}`}
200+
<UncontrolledTooltip placement="right" target={`disabled-tooltip-${componentId}`}
201201
modifiers={[preventOverflow]}>
202202
{disabled}
203-
</RS.UncontrolledTooltip>
203+
</UncontrolledTooltip>
204204
</div>}
205205
</div>
206-
</RS.Row>
206+
</Row>
207207
</div>
208208

209209
{accordionIcon && isPhy && <span className={"accordion-icon align-self-center accordion-icon-" + accordionIcon}>
210210
<span className="visually-hidden">{accordionIcon == "tick" ? "All questions in this part are answered correctly" : "All questions in this part are answered incorrectly"}</span>
211211
</span>}
212-
</RS.Button>
212+
</Button>
213213
</div>
214-
<RS.Collapse isOpen={isOpen} className="mt-1">
214+
<Collapse isOpen={isOpen} className="mt-1">
215215
<AccordionSectionContext.Provider value={{id, clientId: clientId.current, open: isOpen}}>
216-
<RS.Card>
217-
<RS.CardBody>
216+
<Card>
217+
<CardBody>
218218
{children}
219-
</RS.CardBody>
219+
</CardBody>
220220
<ReportAccordionButton pageId={getPage()?.id} sectionId={id} sectionTitle={trustedTitle}/>
221-
</RS.Card>
221+
</Card>
222222
</AccordionSectionContext.Provider>
223-
</RS.Collapse>
223+
</Collapse>
224224
</div>;
225225
});

src/app/components/elements/BookChapter.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import React from "react";
2-
import * as RS from "reactstrap";
32
import {closeActiveModal, openActiveModal, useAppDispatch} from "../../state";
43
import {PageFragment} from "./PageFragment";
54
import {SUBJECTS} from "../../services";
5+
import { Container } from "reactstrap";
66

77
interface ChapterProps {
88
chapterId: string;
@@ -25,7 +25,7 @@ export const BookChapter = ({chapterId, chapterTitle, chapterSubHeading, chapter
2525
}));
2626
}
2727

28-
return <RS.Container>
28+
return <Container>
2929
<button onClick={() => bookChapterLoad()} className="btn book-chapter">
3030
<span className="icon-stack">
3131
<svg className="book-contents-icon" viewBox="0 0 11.7 13.5">
@@ -35,5 +35,5 @@ export const BookChapter = ({chapterId, chapterTitle, chapterSubHeading, chapter
3535
</span>
3636
{chapterTitle} <br/><span className="chapter-subheading">{chapterSubHeading}</span>
3737
</button>
38-
</RS.Container>;
38+
</Container>;
3939
};

0 commit comments

Comments
 (0)