Changeset 8d83180 for reactapp/src/Pages
- Timestamp:
- 10/11/22 15:41:16 (2 years ago)
- Branches:
- main
- Children:
- c68150f
- Parents:
- cae16b5
- Location:
- reactapp/src/Pages
- Files:
-
- 4 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
reactapp/src/Pages/Professor.js
rcae16b5 r8d83180 23 23 import { useNavigate } from "react-router-dom"; 24 24 import axios from "../api/axios"; 25 import { CurrentPageNav } from "../Components/Styled/Main.style"; 25 26 26 27 function Professor(user, userLoaded) { … … 34 35 const [postTitle, setPostTitle] = useState(""); 35 36 const [postContent, setPostContent] = useState(""); 37 const [fetchError, setFetchError] = useState(false); 36 38 37 39 useEffect(() => { … … 47 49 setLoaded(true); 48 50 } catch (error) { 49 console.log("Fetching error", error);51 setFetchError(true); 50 52 } 51 53 }; … … 95 97 return ( 96 98 <div> 99 <CurrentPageNav> 100 »{" "} 101 <a href={"/university/" + professor.faculty.university.universityId}> 102 {professor.faculty.university.universityName} 103 </a>{" "} 104 »{" "} 105 <a href={"/faculty/" + professor.faculty.facultyId}> 106 {professor.faculty.facultyName} 107 </a>{" "} 108 » <a href="#">{professor.professorName}</a> 109 </CurrentPageNav> 97 110 <ProfessorCard> 98 111 <ProfessorCardName>{professor.professorName}</ProfessorCardName> … … 168 181 </div> 169 182 ); 170 } else {183 } else if (!fetchError) { 171 184 return ( 172 185 <div> … … 175 188 </div> 176 189 ); 190 } else { 191 return ( 192 <div style={{ marginTop: "140px" }}> 193 <h1 style={{ textAlign: "center" }}>Страницата не е пронајдена.</h1> 194 </div> 195 ); 177 196 } 178 197 }
Note:
See TracChangeset
for help on using the changeset viewer.