Index: reactapp/src/Pages/Professor.js
===================================================================
--- reactapp/src/Pages/Professor.js	(revision 8dffe022a42c8c6fdea90df3276eb16b6610b51f)
+++ reactapp/src/Pages/Professor.js	(revision ebc51762bbd1b4345d8908789af87bdc49aad058)
@@ -23,46 +23,38 @@
 import { useNavigate } from "react-router-dom";
 import axios from "../api/axios";
-import { CurrentPageNav } from "../Components/Styled/Main.style";
-import LoadingSpinner from "../Components/Styled/LoadingSpinner.style";
 
-function Professor() {
+function Professor(user, userLoaded) {
   let params = useParams();
+
+  let [professor, setProfessor] = useState(null);
+  let [loaded, setLoaded] = useState(null);
+  let [postModalDisplay, setPostModalDisplay] = useState("none");
   let navigate = useNavigate();
-
-  const [professor, setProfessor] = useState(null);
-  const [loadedProfessor, setLoadedProfessor] = useState(false);
-  const [relatedOpinions, setRelatedOpinions] = useState(null);
-  const [loadedRelatedOpinions, setLoadedRelatedOpinions] = useState(false);
-
-  const [postModalDisplay, setPostModalDisplay] = useState("none");
   const { auth, setAuth } = useContext(AuthApi);
+  const [postTitle, setPostTitle] = useState("");
   const [postContent, setPostContent] = useState("");
-  const [fetchError, setFetchError] = useState(false);
-  const [errorMessage, setErrorMessage] = useState("");
 
   useEffect(() => {
-     Promise.all([fetch(`http://192.168.1.108:8080/public/professor/${params.professorId}`),
-     fetch(`http://192.168.1.108:8080/public/professor/${params.professorId}/relatedOpinions`)])
-        .then(([resProfessor, resRelatedOpinions]) => Promise.all([resProfessor.json(), resRelatedOpinions.json()]))
-        .then(([dataProfessor, dataRelatedOpinions]) => {
-          let cyclicGraph1 = dataProfessor;
-          let jsogStructure1 = JSOG.encode(cyclicGraph1);
-          cyclicGraph1 = JSOG.decode(jsogStructure1);
-          setProfessor(cyclicGraph1);
-          setLoadedProfessor(true);
+    const url = `http://192.168.0.17:8080/public/professor/${params.professorId}`;
 
-          let cyclicGraph2 = dataRelatedOpinions;
-          let jsogStructure2 = JSOG.encode(cyclicGraph2);
-          cyclicGraph2 = JSOG.decode(jsogStructure2);
-          setRelatedOpinions(cyclicGraph2);
-          setLoadedRelatedOpinions(true);
-        })
+    const fetchData = async () => {
+      try {
+        const response = await fetch(url);
+        var cyclicGraph = await response.json();
+        var jsogStructure = JSOG.encode(cyclicGraph);
+        cyclicGraph = JSOG.decode(jsogStructure);
+        setProfessor(cyclicGraph);
+        setLoaded(true);
+      } catch (error) {
+        console.log("Fetching error", error);
+      }
+    };
 
-  }, []);
+    fetchData();
+  }, [params.professorId]);
 
   const handleAddOpinionButtonClick = () => {
     if (auth) {
       setPostModalDisplay("block");
-      document.body.style.overflowY = "hidden";
     } else {
       navigate("/login");
@@ -72,5 +64,4 @@
   const handleModalCloseClick = () => {
     setPostModalDisplay("none");
-    document.body.style.overflowY = "auto";
   };
 
@@ -78,20 +69,21 @@
     e.preventDefault();
 
-    if (!postContent.length < 1) {
-      const response = await axios(
-        `http://192.168.1.108:8080/secure/professor/${params.professorId}/addOpinion`,
-        {
-          method: "post",
-          data: {
-            content: postContent,
-          },
-          withCredentials: true,
-        }
-      );
-      setErrorMessage("");
-      window.location.reload();
-    } else {
-      setErrorMessage("Полето за содржина не смее да биде празно");
-    }
+    const response = await axios(
+      `http://192.168.0.17:8080/secure/professor/${professor.professorId}/addOpinion`,
+      {
+        method: "post",
+        data: {
+          title: postTitle,
+          content: postContent,
+        },
+        withCredentials: true,
+      }
+    );
+
+    window.location.reload(false);
+  };
+
+  const handleTitleChange = (e) => {
+    setPostTitle(e.target.value);
   };
 
@@ -100,20 +92,9 @@
   };
 
-  if (loadedProfessor) {
+  if (loaded) {
     return (
       <div>
-        <CurrentPageNav>
-          &#187;{" "}
-          <a href={"/university/" + professor.faculty.university.universityId}>
-            {professor.faculty.university.universityName}
-          </a>{" "}
-          &#187;{" "}
-          <a href={"/faculty/" + professor.faculty.facultyId}>
-            {professor.faculty.facultyName}
-          </a>{" "}
-          &#187; <a href="#">{professor.professorName}</a>
-        </CurrentPageNav>
         <ProfessorCard>
-          <ProfessorCardName>{professor.professorName} <span style={{opacity:"50%", fontSize:"16px"}}>#{professor.professorId}</span></ProfessorCardName>
+          <ProfessorCardName>{professor.professorName}</ProfessorCardName>
           <ProfessorCardSeparator />
           <div style={{ marginTop: "10px" }}>
@@ -126,5 +107,5 @@
           </div>
         </ProfessorCard>
-        <div style={{ height: "20px", marginBottom: "50px" }}>
+        <div style={{ height: "20px", marginBottom: "30px" }}>
           <h3
             style={{
@@ -132,6 +113,6 @@
             }}
           >
-            {relatedOpinions.length}{" "}
-            {relatedOpinions.length !== 1 ? "мислења" : "мислење"}
+            {professor.relatedOpinions.length}{" "}
+            {professor.relatedOpinions.length !== 1 ? "мислења" : "мислење"}
           </h3>
           {auth && (
@@ -152,4 +133,13 @@
             <form onSubmit={handlePostSubmit}>
               <ModalBody>
+                <label htmlFor="title">
+                  <b>Наслов</b>:
+                  <ModalInput
+                    id="title"
+                    type="text"
+                    value={postTitle}
+                    onChange={handleTitleChange}
+                  />
+                </label>
                 <label htmlFor="content">
                   <b>Содржина</b>:
@@ -158,5 +148,4 @@
                     rows="8"
                     cols="100"
-                    spellCheck={false}
                     value={postContent}
                     onChange={handleContentChange}
@@ -164,9 +153,4 @@
                 </label>
               </ModalBody>
-              <p
-                style={{ color: "red", marginLeft: "15px", marginTop: "10px" }}
-              >
-                {errorMessage}
-              </p>
               <ModalFooter type="submit">ОБЈАВИ</ModalFooter>
             </form>
@@ -175,13 +159,10 @@
 
         <div className="opinionTree">
-          <OpinionTree professor={professor} relatedOpinions={relatedOpinions}/>
+          <OpinionTree
+            professor={professor}
+            user={user}
+            userLoaded={userLoaded}
+          />
         </div>
-        <Outlet />
-      </div>
-    );
-  } else if (!fetchError) {
-    return (
-      <div>
-        <LoadingSpinner style={{ marginTop: "140px" }}/>
         <Outlet />
       </div>
@@ -189,6 +170,7 @@
   } else {
     return (
-      <div style={{ marginTop: "140px" }}>
-        <h1 style={{ textAlign: "center" }}>Страницата не е пронајдена.</h1>
+      <div>
+        <p style={{ marginTop: "140px" }}>се вчитува...</p>
+        <Outlet />
       </div>
     );
