Skip to content

Commit 9c496aa

Browse files
committed
Fix the disappearing of search field, sort and import buttons when switching tutoriums within the same view with opened create student form. #1048
1 parent 00680c7 commit 9c496aa

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

client/src/pages/studentmanagement/TutorStudentmanagement.tsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
import { Button } from '@material-ui/core';
2-
import React, { useCallback, useState } from 'react';
2+
import { TableArrowDown as ImportIcon } from 'mdi-material-ui';
3+
import { useCallback, useEffect, useState } from 'react';
34
import { useParams } from 'react-router';
4-
import { ROUTES } from '../../routes/Routing.routes';
5+
import { Link } from 'react-router-dom';
56
import StudentForm, {
67
convertFormStateToDTO,
78
StudentFormSubmitCallback,
89
} from '../../components/forms/StudentForm';
910
import LoadingSpinner from '../../components/loading/LoadingSpinner';
1011
import OpenableFormWithFab, { EditorOpenState } from '../../components/OpenableFormWithFab';
12+
import { ROUTES } from '../../routes/Routing.routes';
1113
import StudentList from './student-list/StudentList';
1214
import { useStudentsForStudentList } from './student-list/StudentList.helpers';
13-
import { Link } from 'react-router-dom';
14-
import { TableArrowDown as ImportIcon } from 'mdi-material-ui';
1515

1616
interface Params {
1717
tutorialId: string;
@@ -24,6 +24,10 @@ function TutorStudentmanagement(): JSX.Element {
2424
isEditorOpen: false,
2525
});
2626

27+
useEffect(() => {
28+
setEditorState({ isAnimating: false, isEditorOpen: false });
29+
}, [tutorialId]);
30+
2731
const { students, teams, summaries, isLoading, createStudent, editStudent, deleteStudent } =
2832
useStudentsForStudentList({ tutorialId });
2933

0 commit comments

Comments
 (0)