File tree 1 file changed +5
-4
lines changed
1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -4,11 +4,9 @@ import { useParams } from 'react-router-dom';
4
4
import useFetch from '../hooks/useFetch' ;
5
5
6
6
function Programme ( ) {
7
-
8
7
const dept = useParams ( ) ?. dept ;
9
- const Programs = useFetch ( `/dept/${ dept } /programmeInfo` ) . data ;
10
-
11
8
const [ programInfo , setProgramInfo ] = useState ( { } ) ;
9
+ const Programs = useFetch ( `/dept/${ dept } /programmeInfo` ) . data ;
12
10
13
11
const handlescroll = ( id ) => {
14
12
let str = "#" + id ;
@@ -18,7 +16,8 @@ function Programme() {
18
16
}
19
17
useEffect ( ( ) => {
20
18
window . scroll ( 0 , 0 ) ;
21
- } , [ ] )
19
+ setProgramInfo ( Programs [ 0 ] )
20
+ } , [ Programs ] )
22
21
const departments = {
23
22
"it" : "Information Technology" ,
24
23
"cse" : "Computer Science and Engineering" ,
@@ -37,7 +36,9 @@ function Programme() {
37
36
"cy" : "Chemistry" ,
38
37
'cee' :'Center for Energy and Environment' , 'cai' :'Center for Artificial Intelligence' ,
39
38
}
39
+
40
40
return (
41
+
41
42
< >
42
43
< div className = "text-gray-600 body-font w-full h-full" >
43
44
< div className = "container flex flex-col px-5 py-12 mx-auto" style = { { height : "100%" } } >
You can’t perform that action at this time.
0 commit comments