l-min-components 1.7.1569 → 1.7.1570

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "l-min-components",
3
- "version": "1.7.1569",
3
+ "version": "1.7.1570",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "src/assets",
@@ -57,6 +57,7 @@ import { NavBack, NavForword } from "../fullAnalysis/icons/navArrow";
57
57
  * @param {string} props.testId
58
58
  * @param {Array} props.questions
59
59
  * @param {string} props.questionActivityID
60
+ * @param {object} props.navControl
60
61
  * @returns {React.ReactNode}
61
62
  */
62
63
  import useTranslation from "../../../hooks/useTranslation.jsx";
@@ -72,6 +73,13 @@ const ReportQuestions = ({
72
73
  onSwitchQuestion,
73
74
  loading,
74
75
  mainTitle,
76
+ navControl = {
77
+ on: false,
78
+ disablePrev: false,
79
+ disableNext: false,
80
+ onNext: () => {},
81
+ onPrev: () => {},
82
+ },
75
83
  }) => {
76
84
  const { findText } = useTranslation(wordStore);
77
85
  const [questionList, setQuestionList] = useState([]);
@@ -251,14 +259,35 @@ const ReportQuestions = ({
251
259
  <InfoIcon2 />
252
260
  </ScoreHeader>
253
261
  <QuestionNav>
254
- <button disabled={!prevId} onClick={handlePrev}>
255
- <NavBack disabled={!prevId} />
256
- {findText("Previous question")}
257
- </button>
258
- <button disabled={!nextId} onClick={handleNext}>
259
- {findText("Next question")}
260
- <NavForword disabled={!nextId} />
261
- </button>
262
+ {navControl?.on ? (
263
+ <>
264
+ <button
265
+ disabled={navControl.disablePrev}
266
+ onClick={navControl.onPrev}
267
+ >
268
+ <NavBack disabled={navControl.disablePrev} />
269
+ {findText("Previous question")}
270
+ </button>
271
+ <button
272
+ disabled={navControl.disableNext}
273
+ onClick={navControl.onNext}
274
+ >
275
+ {findText("Next question")}
276
+ <NavForword disabled={navControl.disableNext} />
277
+ </button>
278
+ </>
279
+ ) : (
280
+ <>
281
+ <button disabled={!prevId} onClick={handlePrev}>
282
+ <NavBack disabled={!prevId} />
283
+ {findText("Previous question")}
284
+ </button>
285
+ <button disabled={!nextId} onClick={handleNext}>
286
+ {findText("Next question")}
287
+ <NavForword disabled={!nextId} />
288
+ </button>
289
+ </>
290
+ )}
262
291
  </QuestionNav>
263
292
  </ScoreHeaderContainer>
264
293
  {/* {data && !hasAnswer && <ErrorHeader />} */}