diff --git a/src/components/Modals/AddStudentsModal/AddSudentsModal.tsx b/src/components/Modals/AddStudentsModal/AddSudentsModal.tsx index 5887933..5a6ec6c 100644 --- a/src/components/Modals/AddStudentsModal/AddSudentsModal.tsx +++ b/src/components/Modals/AddStudentsModal/AddSudentsModal.tsx @@ -13,16 +13,14 @@ import { import { useDisclosure, Divider } from '@chakra-ui/react'; import { MdGroup } from 'react-icons/md'; -type AddStudentsModalPropsType = {}; - -const AddStudentsModal: React.FC = () => { - const { isOpen, onOpen, onClose } = useDisclosure(); +type AddStudentsModalPropsType = { + isOpen: boolean; + onClose: () => void; +}; +const AddStudentsModal: React.FC = ({ isOpen, onClose }) => { return ( <> - diff --git a/src/pages/courses/edit/components/LessonList/LessonList.tsx b/src/pages/courses/edit/components/LessonList/LessonList.tsx index cd6694e..8ef8946 100644 --- a/src/pages/courses/edit/components/LessonList/LessonList.tsx +++ b/src/pages/courses/edit/components/LessonList/LessonList.tsx @@ -46,7 +46,7 @@ const CreateLessonButton: React.FC<{ id: string }> = ({ id }) => { const handleCreateLesson = (): void => history.push(`${id}/create-lesson`); return ( - ); @@ -206,7 +206,9 @@ const LessonList: React.FC = ({ course }) => { )} Total: ({lessons.length}) - + = ({ course }) => { ) : ( No lessons have been added to this course yet - - - + )} diff --git a/src/pages/courses/edit/components/StudentTableList/StudentTableList.tsx b/src/pages/courses/edit/components/StudentTableList/StudentTableList.tsx index 5289beb..8ab4406 100644 --- a/src/pages/courses/edit/components/StudentTableList/StudentTableList.tsx +++ b/src/pages/courses/edit/components/StudentTableList/StudentTableList.tsx @@ -1,11 +1,9 @@ import React from 'react'; -import { Table, Tbody, Button, Menu, MenuButton, MenuList, MenuItem } from '@chakra-ui/react'; -import { Input, InputGroup, InputLeftElement } from '@chakra-ui/react'; -import { Flex, Box, Text } from '@chakra-ui/react'; -import { DeleteIcon, ChevronDownIcon } from '@chakra-ui/icons'; -import { MdSearch, MdImportExport, MdRemove } from 'react-icons/md'; +import { Table, Tbody, Button, Input, InputGroup, InputLeftElement, Flex, Box, Text } from '@chakra-ui/react'; +import { MdSearch } from 'react-icons/md'; import AddStudentsModal from '@educt/components/Modals/AddStudentsModal'; +import BulkActionsMenu from './BulkActionsMenu'; import StudentTableHead from './StudentTableHead'; /** @@ -18,7 +16,7 @@ import type { ICourse } from '@educt/interfaces'; * Hooks */ import { useCallback, useState } from 'react'; -import BulkActionsMenu from './BulkActionsMenu'; +import { useDisclosure } from '@chakra-ui/react'; type StudentTableListPropsType = { render: React.FC; @@ -29,6 +27,11 @@ const StudentTableList: React.FC = ({ render: Row, st const [rows, setRows] = useState(students); const [selected, setSelected] = useState([]); const [search, setSearch] = useState(''); + const { + isOpen: isOpenAddStudentModal, + onOpen: onOpenAddStudentModal, + onClose: onCloseAddStudentModal, + } = useDisclosure(); /** * Search for a student by input @@ -68,15 +71,21 @@ const StudentTableList: React.FC = ({ render: Row, st if (rows.length === 0) { return ( - - There are no students in the course yet - - + <> + + + There are no students in the course yet + + + ); } return ( + @@ -94,12 +103,12 @@ const StudentTableList: React.FC = ({ render: Row, st )} - - +
{rows.map(student => (