@@ -4,9 +4,11 @@ import { useCourseOverviewQuery } from '../../generated/graphql';
44//package for date format
55import moment from 'moment' ;
66
7- const overviewStyle = "flex flex-col m-auto bg-white w-11/12 md:w-10/12 lg:w-9/12 xl:w-7/12 shadow-xl mt-8" ;
8- const headerStyle = "flex bg-green shadow-md p-4 justify-center text-white text-md sm:text-lg md:text-xl" ;
9- const historyStyle = "flex flex-row flex-wrap justify-start w-full" ;
7+ const overviewStyle =
8+ 'flex flex-col m-auto bg-white w-11/12 md:w-10/12 lg:w-9/12 xl:w-7/12 shadow-xl mt-8' ;
9+ const headerStyle =
10+ 'flex bg-green shadow-md p-4 justify-center text-white text-md sm:text-lg md:text-xl' ;
11+ const historyStyle = 'flex flex-row flex-wrap justify-start w-full' ;
1012
1113const Overview : React . FC = ( ) => {
1214 const courseId = Number ( useParams ( ) . courseId ) ;
@@ -20,30 +22,30 @@ const Overview: React.FC = () => {
2022 } // TODO handle error
2123
2224 const history = data ?. getCourseOverview ?. data ;
23- const total = history ?. studentTotal ;
2425 const sessions = history ?. sessions ;
2526
2627 console . log ( 'history: ' , history ) ;
2728 return (
2829 < div >
2930 < div className = { overviewStyle } >
30- < header >
31- < h3 className = { headerStyle } > Students assigned to this course: { total } </ h3 >
32- </ header >
33- < article className = "flex flex-col justify-center" >
34- < p className = "m-auto text-xl" > Attendance</ p >
31+ < article className = 'flex flex-col justify-center' >
32+ < p className = 'm-auto text-xl' > Attendance</ p >
3533 < section className = { historyStyle } >
3634 { ! ! sessions &&
3735 sessions . map ( ( session ) => {
3836 if ( session ) {
3937 const date = new Date ( Number ( session . createdAt ) ) ;
4038 const UTCdate = date . toUTCString ( ) ;
4139 return (
42- < div className = " w-26 p-2 md:w-32 text-center border-2 border-black m-1 hover:bg-green-xlight" >
40+ < div className = ' w-26 p-2 md:w-32 text-center border-2 border-black m-1 hover:bg-green-xlight' >
4341 < Link to = { `/homepage/classes/${ courseId } /${ session . id } ` } >
4442 < div >
45- < h5 className = "text-lg sm:text-xl" > { session . attendance } </ h5 >
46- < p className = "text-sm sm:text-md" > { moment ( UTCdate ) . format ( 'L' ) } </ p >
43+ < h5 className = 'text-lg sm:text-xl' >
44+ { session . attendance }
45+ </ h5 >
46+ < p className = 'text-sm sm:text-md' >
47+ { moment ( UTCdate ) . format ( 'L' ) }
48+ </ p >
4749 </ div >
4850 </ Link >
4951 </ div >
0 commit comments