ENCOA-228 Now when user navigates between modules the generation items persist. Reading, listening and writing added to level module
This commit is contained in:
@@ -7,6 +7,8 @@ import useExamEditorStore from '@/stores/examEditor';
|
||||
import { ModuleState } from '@/stores/examEditor/types';
|
||||
import ListeningContext from './SectionContext/listening';
|
||||
import SectionDropdown from '../Shared/SectionDropdown';
|
||||
import LevelContext from './SectionContext/level';
|
||||
import { Module } from '@/interfaces';
|
||||
|
||||
|
||||
const SectionRenderer: React.FC = () => {
|
||||
@@ -39,9 +41,10 @@ const SectionRenderer: React.FC = () => {
|
||||
}
|
||||
};
|
||||
|
||||
const ContextMap: Record<string, React.ComponentType<{ sectionId: number; }>> = {
|
||||
const ContextMap: Record<string, React.ComponentType<{ sectionId: number; module: Module }>> = {
|
||||
reading: ReadingContext,
|
||||
listening: ListeningContext,
|
||||
level: LevelContext,
|
||||
};
|
||||
|
||||
const SectionContext = ContextMap[currentModule];
|
||||
@@ -83,7 +86,7 @@ const SectionRenderer: React.FC = () => {
|
||||
onFocus={() => updateModule({ focusedSection: id })}
|
||||
tabIndex={id + 1}
|
||||
>
|
||||
{currentModule in ContextMap && <SectionContext sectionId={id} />}
|
||||
{currentModule in ContextMap && <SectionContext sectionId={id} module={currentModule} />}
|
||||
<SectionExercises sectionId={id} />
|
||||
</div>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user