@@ -6,6 +6,7 @@ import Course from '../../Types/course';
66import { ReactComponent as CloseBtn } from '../../Assets/window-close-regular.svg' ;
77import ClassDashboard from './ClassDashboard' ;
88import Overview from '../Calendar/Overview' ;
9+ import User from '../../Types/user' ;
910
1011const headerStyle =
1112 'bg-black text-white flex flex-row justify-between items-center content-center p-8 h-20 mb-4 text-3xl' ;
@@ -20,6 +21,10 @@ const ClassView: React.FC = () => {
2021 ( state : { selectedCourse : Course | null } ) => state . selectedCourse
2122 ) ;
2223 const history = useSelector ( ( state : { history : boolean } ) => state . history ) ;
24+ const students = useSelector (
25+ ( state : { currentList : User [ ] } ) => state . currentList
26+ ) ;
27+
2328 const courseId = course ?. id ;
2429
2530 const link = history
@@ -28,23 +33,24 @@ const ClassView: React.FC = () => {
2833
2934 if ( course && courseId ) {
3035 return (
31- < section className = ' h-screen flex flex-col justify-start w-3/4' >
36+ < section className = " h-screen flex flex-col justify-start w-3/4" >
3237 < div className = { headerStyle } >
33- < h1 className = ' font-bold' > { course . name ?. toUpperCase ( ) } </ h1 >
34- < Link to = ' /homepage' >
38+ < h1 className = " font-bold" > { course . name ?. toUpperCase ( ) } </ h1 >
39+ < Link to = " /homepage" >
3540 < button onClick = { ( ) => dispatch ( setSelected ( null ) ) } >
36- < CloseBtn className = ' w-10 h-10' />
41+ < CloseBtn className = " w-10 h-10" />
3742 </ button >
3843 </ Link >
3944 </ div >
40- < article className = ' flex flex-col px-10' >
41- < div className = ' flex flex-row justify-around w-full' >
45+ < article className = " flex flex-col px-10" >
46+ < div className = " flex flex-row justify-around w-full" >
4247 < div className = { listHeader } >
43- Students { history && `assigned to this course:` }
48+ Students{ ' ' }
49+ { history && `assigned to this course: ${ students . length } ` }
4450 </ div >
4551 < Link to = { link } className = { attendanceStyle } >
4652 < h3
47- className = ' text-lg'
53+ className = " text-lg"
4854 onClick = { ( ) => dispatch ( setHistory ( history ) ) }
4955 >
5056 { history ? 'Back to dashboard' : 'Attendance history' }
0 commit comments