@@ -4,11 +4,9 @@ import { useCourseOverviewQuery } from '../../generated/graphql';
44//package for date format
55import moment from 'moment' ;
66
7- const overviewStyle =
8- 'flex flex-col m-auto bg-green w-11/12 md:w-10/12 lg:w-9/12 xl:w-7/12 mt-8 h-1/2 lg:h-3/4 px-2 pb-2' ;
7+ const overviewStyle = 'flex flex-col w-11/12 mt-4 self-center' ;
98
10- const historyStyle =
11- 'flex flex-row flex-wrap justify-start bg-white w-full overflow-scroll h-6/7' ;
9+ const historyStyle = 'grid grid-cols-6 bg-white w-full h-6/7' ;
1210
1311const Overview : React . FC = ( ) => {
1412 const courseId = Number ( useParams ( ) . courseId ) ;
@@ -26,35 +24,35 @@ const Overview: React.FC = () => {
2624
2725 console . log ( 'history: ' , history ) ;
2826 return (
29- < div className = "h-screen" >
30- < div className = { overviewStyle } >
31- < article className = 'flex flex-col justify -center h-full ' >
32- < p className = 'm-auto text-xl text-white pb-2 h-8 flex' > Attendance</ p >
33- < section className = { historyStyle } >
34- { ! ! sessions &&
35- sessions . map ( ( session ) => {
36- if ( session ) {
37- const date = new Date ( Number ( session . createdAt ) ) ;
38- const UTCdate = date . toUTCString ( ) ;
39- return (
40- < div className = 'h-20 p-2 w-32 text-center border-2 border-black m-1 hover:bg-green-xlight' >
41- < Link to = { `/homepage/classes/ ${ courseId } / ${ session . id } ` } >
42- < div >
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 >
49- </ div >
50- </ Link >
51- </ div >
52- ) ;
53- }
54- } ) }
55- </ section >
56- </ article >
57- </ div >
27+ < div className = { overviewStyle } >
28+ < article className = 'flex flex-col justify-center h-full' >
29+ < p className = 'flex justify-center items -center text-4xl bg-green text-white h-16 ' >
30+ Sessions Attendance
31+ </ p >
32+ < section className = { historyStyle } >
33+ { ! ! sessions &&
34+ sessions . map ( ( session ) => {
35+ if ( session ) {
36+ const date = new Date ( Number ( session . createdAt ) ) ;
37+ const UTCdate = date . toUTCString ( ) ;
38+ return (
39+ < div className = 'flex items-center justify-center h-32 w-32 text-center border-2 border-white hover:border-green' >
40+ < Link to = { `/homepage/classes/ ${ courseId } / ${ session . id } ` } >
41+ < div >
42+ < h5 className = 'font-bold text-6xl text-green' >
43+ { session . attendance }
44+ </ h5 >
45+ < p className = 'text-sm sm:text-md text-black' >
46+ { moment ( UTCdate ) . format ( 'L' ) }
47+ </ p >
48+ </ div >
49+ </ Link >
50+ </ div >
51+ ) ;
52+ }
53+ } ) }
54+ </ section >
55+ </ article >
5856 </ div >
5957 ) ;
6058} ;
0 commit comments