1
- import React , { useMemo , useContext , useEffect , useState } from 'react' ;
2
- import { Box , Typography , useMediaQuery } from '@mui/material' ;
1
+ import React , { useMemo , useContext } from 'react' ;
2
+ import { Box , useMediaQuery } from '@mui/material' ;
3
3
import useFetch from '../utils/useFetch' ;
4
4
import Loader from '../components/Loader' ;
5
5
import GradeAccordion from '../components/GradeAccordion' ;
6
6
import GradeGrid from '../components/GradeGrid' ;
7
7
import Grid from '@mui/material/Unstable_Grid2' ;
8
- import ProjectionTable from '../components/ProjectionTable' ;
8
+ // import ProjectionTable from '../components/ProjectionTable';
9
9
import { StudentSelectionContext } from "../components/StudentSelectionWrapper" ;
10
10
11
11
function Home ( ) {
12
12
13
- const [ binsData , setBinsData ] = useState ( [ ] ) ;
13
+ // const [binsData, setBinsData] = useState([]);
14
14
15
15
const mobileView = useMediaQuery ( '(max-width:600px)' ) ;
16
16
@@ -20,17 +20,17 @@ function Home() {
20
20
return selectedStudent || localStorage . getItem ( 'email' ) ;
21
21
} , [ selectedStudent ] ) ;
22
22
23
- const binsInfo = useFetch ( '/bins' ) ;
23
+ // const binsInfo = useFetch('/bins');
24
24
const gradeInfo = useFetch ( `students/${ fetchEmail } /grades` ) ;
25
- const projectionsInfo = useFetch ( `/students/${ fetchEmail } /projections` ) ;
25
+ // const projectionsInfo = useFetch(`/students/${fetchEmail}/projections`);
26
26
27
- useEffect ( ( ) => {
28
- if ( binsInfo . data && localStorage . getItem ( 'token' ) ) {
29
- setBinsData ( binsInfo . data . map ( ( { letter, points } ) => [ points , letter ] ) ) ;
30
- }
31
- } , [ binsInfo . data ] ) ;
27
+ // useEffect(() => {
28
+ // if (binsInfo.data && localStorage.getItem('token')) {
29
+ // setBinsData(binsInfo.data.map(({ letter, points }) => [points, letter]));
30
+ // }
31
+ // }, [binsInfo.data]);
32
32
33
- if ( gradeInfo . loading || binsInfo . loading || projectionsInfo . loading ) {
33
+ if ( gradeInfo . loading /* || binsInfo.loading || projectionsInfo.loading */ ) {
34
34
return ( < Loader /> ) ;
35
35
}
36
36
@@ -59,14 +59,14 @@ function Home() {
59
59
</ Grid >
60
60
</ Box >
61
61
}
62
- { localStorage . getItem ( 'token' ) &&
62
+ { /* { localStorage.getItem('token') &&
63
63
<Box>
64
64
<Typography variant='h5' component='div' sx={{ mt: 6, mb: 2, fontWeight: 500, textAlign: 'center' }}>Grade Projections</Typography>
65
65
<Box sx={{ mb: 4, display: 'flex', flexBasis: 'min-content', justifyContent: 'center' }}>
66
66
<ProjectionTable projections={projectionsInfo.data} gradeData={binsData} />
67
67
</Box>
68
68
</Box>
69
- }
69
+ } */ }
70
70
</ Box >
71
71
) ;
72
72
}
0 commit comments