Navigation rework, added prompt edit to components that were missing
This commit is contained in:
@@ -6,10 +6,10 @@ import Writing from "@/exams/Writing";
|
||||
import { usePersistentStorage } from "@/hooks/usePersistentStorage";
|
||||
import { LevelExam, ListeningExam, ReadingExam, SpeakingExam, WritingExam } from "@/interfaces/exam";
|
||||
import { User } from "@/interfaces/user";
|
||||
import { usePersistentExamStore } from "@/stores/examStore";
|
||||
import { usePersistentExamStore } from "@/stores/exam";
|
||||
import clsx from "clsx";
|
||||
|
||||
// todo: perms
|
||||
// TODO: perms
|
||||
|
||||
const Popout: React.FC<{ user: User }> = ({ user }) => {
|
||||
const state = usePersistentExamStore((state) => state);
|
||||
@@ -18,35 +18,19 @@ const Popout: React.FC<{ user: User }> = ({ user }) => {
|
||||
<div className={`relative flex w-full min-h-screen p-4 shadow-md items-center rounded-2xl ${state.bgColor}`}>
|
||||
<div className={clsx("relative flex p-20 justify-center flex-1")}>
|
||||
{state.exam?.module == "level" && state.exam.parts && state.partIndex >= 0 &&
|
||||
<Level exam={state.exam as LevelExam} onFinish={() => {
|
||||
state.setPartIndex(0);
|
||||
state.setExerciseIndex(0);
|
||||
state.setQuestionIndex(0);
|
||||
}} preview={true} />
|
||||
<Level exam={state.exam as LevelExam} preview={true} />
|
||||
}
|
||||
{state.exam?.module == "writing" && state.exam.exercises && state.partIndex >= 0 &&
|
||||
<Writing exam={state.exam as WritingExam} onFinish={() => {
|
||||
state.setExerciseIndex(0);
|
||||
}} preview={true} />
|
||||
<Writing exam={state.exam as WritingExam} preview={true} />
|
||||
}
|
||||
{state.exam?.module == "reading" && state.exam.parts.length > 0 &&
|
||||
<Reading exam={state.exam as ReadingExam} onFinish={() => {
|
||||
state.setPartIndex(0);
|
||||
state.setExerciseIndex(-1);
|
||||
state.setQuestionIndex(0);
|
||||
}} preview={true} />
|
||||
<Reading exam={state.exam as ReadingExam} preview={true} />
|
||||
}
|
||||
{state.exam?.module == "listening" && state.exam.parts.length > 0 &&
|
||||
<Listening exam={state.exam as ListeningExam} onFinish={() => {
|
||||
state.setPartIndex(0);
|
||||
state.setExerciseIndex(-1);
|
||||
state.setQuestionIndex(0);
|
||||
}} preview={true} />
|
||||
<Listening exam={state.exam as ListeningExam} preview={true} />
|
||||
}
|
||||
{state.exam?.module == "speaking" && state.exam.exercises.length > 0 &&
|
||||
<Speaking exam={state.exam as SpeakingExam} onFinish={() => {
|
||||
state.setExerciseIndex(-1);
|
||||
}} preview={true} />
|
||||
<Speaking exam={state.exam as SpeakingExam} preview={true} />
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user