Add back button and refactor quiz actions in QuizRunner component
This commit is contained in:
@@ -475,7 +475,10 @@ export default function QuizRunner({ defaultMode = 'all', defaultEntryId, autoSt
|
|||||||
)}
|
)}
|
||||||
|
|
||||||
<div className="quiz-actions">
|
<div className="quiz-actions">
|
||||||
{!showResult && (
|
<button className="button button--ghost" onClick={goPrev} disabled={currentIndex === 0}>
|
||||||
|
Back
|
||||||
|
</button>
|
||||||
|
{!showResult ? (
|
||||||
<>
|
<>
|
||||||
<button className="button" onClick={() => handleSubmit(false)}>
|
<button className="button" onClick={() => handleSubmit(false)}>
|
||||||
Submit
|
Submit
|
||||||
@@ -484,12 +487,8 @@ export default function QuizRunner({ defaultMode = 'all', defaultEntryId, autoSt
|
|||||||
Don’t know
|
Don’t know
|
||||||
</button>
|
</button>
|
||||||
</>
|
</>
|
||||||
)}
|
) : (
|
||||||
{showResult && (
|
|
||||||
<>
|
<>
|
||||||
<button className="button button--ghost" onClick={goPrev} disabled={currentIndex === 0}>
|
|
||||||
Back
|
|
||||||
</button>
|
|
||||||
<button className="button button--primary" onClick={goNext}>
|
<button className="button button--primary" onClick={goNext}>
|
||||||
{currentIndex + 1 === questions.length ? 'Finish' : 'Next'}
|
{currentIndex + 1 === questions.length ? 'Finish' : 'Next'}
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
Reference in New Issue
Block a user