- Timestamp:
- 10/11/22 15:41:16 (2 years ago)
- Branches:
- main
- Children:
- c68150f
- Parents:
- cae16b5
- Location:
- reactapp/src
- Files:
-
- 7 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
reactapp/src/App.js
rcae16b5 r8d83180 6 6 import Home from "./Pages/Home"; 7 7 import UserDashboard from "./Pages/UserDashboard"; 8 import Subject from "./Pages/Subject"; 9 import University from "./Pages/University"; 10 import Faculty from "./Pages/Faculty"; 8 11 import { useEffect, useState, useMemo } from "react"; 9 12 import AuthApi from "./api/AuthApi"; … … 11 14 import axios from "./api/axios"; 12 15 import JSOG from "jsog"; 16 import NotFound from "./Pages/NotFound"; 13 17 14 18 export default function App() { … … 77 81 /> 78 82 </Route> 83 <Route path="university/:universityId" element={<University />} /> 84 <Route path="faculty/:facultyId" element={<Faculty />} /> 85 <Route path="subject/:subjectId" element={<Subject />} /> 79 86 <Route path="search" element={<SearchResults />}></Route> 80 87 <Route … … 87 94 ></Route> 88 95 </Route> 96 <Route path="*" element={<NotFound />} /> 89 97 </Routes> 90 98 </BrowserRouter> -
reactapp/src/Components/Styled/Main.style.js
rcae16b5 r8d83180 22 22 color: black; 23 23 `; 24 25 export const CurrentPageNav = styled.div` 26 font-style: italic; 27 font-size: 14px; 28 `; -
reactapp/src/Components/Styled/OpinionCard.style.js
rcae16b5 r8d83180 8 8 margin-bottom: 20px; 9 9 padding: 10px; 10 bo rder: 1px solid black;10 box-shadow: 2px 2px 10px #aaaaaa; 11 11 `; 12 12 -
reactapp/src/Components/Styled/ProfessorCard.style.js
rcae16b5 r8d83180 2 2 3 3 export const ProfessorCard = styled.div` 4 background-color: papayawhip;4 background-color: cornsilk; 5 5 width: auto; 6 6 padding: 10px; 7 7 margin-bottom: 30px; 8 margin-top: 140px;8 margin-top: 40px; 9 9 `; 10 10 -
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.