l-min-components 1.7.1558 → 1.7.1560

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.1558",
3
+ "version": "1.7.1560",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "src/assets",
@@ -73,6 +73,13 @@ const ReportQuestions = ({
73
73
  onSwitchQuestion,
74
74
  loading,
75
75
  mainTitle,
76
+ navControl = {
77
+ on: false,
78
+ disablePrev: false,
79
+ disableNext: false,
80
+ onNext: () => {},
81
+ onPrev: () => {},
82
+ },
76
83
  }) => {
77
84
  const { findText } = useTranslation(wordStore);
78
85
  const [questionList, setQuestionList] = useState([]);
@@ -253,14 +260,35 @@ const ReportQuestions = ({
253
260
  <InfoIcon2 />
254
261
  </ScoreHeader>
255
262
  <QuestionNav>
256
- <button disabled={!prevId} onClick={handlePrev}>
257
- <NavBack disabled={!prevId} />
258
- {findText("Previous question")}
259
- </button>
260
- <button disabled={!nextId} onClick={handleNext}>
261
- {findText("Next question")}
262
- <NavForword disabled={!nextId} />
263
- </button>
263
+ {navControl?.on ? (
264
+ <>
265
+ <button
266
+ disabled={navControl.disablePrev}
267
+ onClick={navControl.onPrev}
268
+ >
269
+ <NavBack disabled={navControl.disablePrev} />
270
+ {findText("Previous question")}
271
+ </button>
272
+ <button
273
+ disabled={navControl.disableNext}
274
+ onClick={navControl.onNext}
275
+ >
276
+ {findText("Next question")}
277
+ <NavForword disabled={navControl.disableNext} />
278
+ </button>
279
+ </>
280
+ ) : (
281
+ <>
282
+ <button disabled={!prevId} onClick={handlePrev}>
283
+ <NavBack disabled={!prevId} />
284
+ {findText("Previous question")}
285
+ </button>
286
+ <button disabled={!nextId} onClick={handleNext}>
287
+ {findText("Next question")}
288
+ <NavForword disabled={!nextId} />
289
+ </button>
290
+ </>
291
+ )}
264
292
  </QuestionNav>
265
293
  </ScoreHeaderContainer>
266
294
  {/* {data && !hasAnswer && <ErrorHeader />} */}