Index: reactapp/src/Components/OpinionTree.js
===================================================================
--- reactapp/src/Components/OpinionTree.js	(revision af801e3ae2a87e526d2053085fdbb077aafd6741)
+++ reactapp/src/Components/OpinionTree.js	(revision 9bf1f8db5dd66185ddc4f7d093582ff73006f66b)
@@ -26,5 +26,5 @@
 import axios from "../api/axios";
 
-function OpinionTree({ professor }) {
+const OpinionTree = ({professor, relatedOpinions}) => {
   var renderedOpinionIds = [];
   var postCount; // za da ne go pokazuva ispod postot
@@ -35,5 +35,9 @@
   const [replyModalDisplay, setReplyModalDisplay] = useState("none");
   const [replyContent, setReplyContent] = useState("");
-  const [postForModal, setPostForModal] = useState(null);
+  const [postForReplyModal, setPostForReplyModal] = useState(null);
+  const [reportModalDisplay, setReportModalDisplay] = useState("none");
+  const [reportContent, setReportContent] = useState("")
+  const [postForReportModal, setPostForReportModal] = useState(null);
+
   const [user, setUser] = useState(null);
   const [loadedUser, setLoadedUser] = useState(false);
@@ -42,5 +46,5 @@
 
   useEffect(() => {
-    const url = `http://192.168.0.29:8080/secure/currentUser`;
+    const url = `http://192.168.1.254:8080/secure/currentUser`;
 
     const fetchUser = async () => {
@@ -68,5 +72,5 @@
       ) {
         const response = await axios(
-          `http://192.168.0.29:8080/secure/upvoteOpinion/${post.postId}`,
+          `http://192.168.1.254:8080/secure/upvoteOpinion/${post.postId}`,
           {
             method: "get",
@@ -91,5 +95,5 @@
       ) {
         const response = await axios(
-          `http://192.168.0.29:8080/secure/downvoteOpinion/${post.postId}`,
+          `http://192.168.1.254:8080/secure/downvoteOpinion/${post.postId}`,
           {
             method: "get",
@@ -110,5 +114,5 @@
     if (auth) {
       setReplyModalDisplay("block");
-      setPostForModal(opinion);
+      setPostForReplyModal(opinion);
       document.body.style.overflowY = "hidden";
     } else {
@@ -116,12 +120,27 @@
     }
   };
+
+  const handleReport = (opinion) => {
+    if (auth) {
+      setReportModalDisplay("block");
+      setPostForReportModal(opinion);
+      document.body.style.overflowY = "hidden";
+    } else {
+      navigate("/login");
+    }
+  }
 
   const handleModalCloseClick = () => {
     setReplyModalDisplay("none");
+    setReportModalDisplay("none");
     document.body.style.overflowY = "auto";
   };
 
-  const handleContentChange = (e) => {
+  const handleReplyContentChange = (e) => {
     setReplyContent(e.target.value);
+  };
+
+  const handleReportContentChange = (e) => {
+    setReportContent(e.target.value);
   };
 
@@ -131,5 +150,5 @@
     if (!replyContent.length < 1) {
       const response = await axios(
-        `http://192.168.0.29:8080/secure/professor/${professor.professorId}/replyToOpinion/${postId}`,
+        `http://192.168.1.254:8080/secure/professor/${professor.professorId}/replyToOpinion/${postId}`,
         {
           method: "post",
@@ -147,7 +166,28 @@
   };
 
+  const handleReportSubmit = async (e, postId) => {
+    e.preventDefault();
+
+    if (!reportContent.length < 1) {
+      const response = await axios(
+          `http://192.168.1.254:8080/secure/reportOpinion/${postId}`,
+          {
+            method: "post",
+            data: {
+              description: reportContent,
+            },
+            withCredentials: true,
+          }
+      );
+      setErrorMessage("");
+      window.location.reload();
+    } else {
+      setErrorMessage("Полето за содржина не смее да биде празно");
+    }
+  };
+
   function displayChildPosts(child, parentPostAuthorUsername, replyIndent) {
     if (child == null) return;
-    postCount = renderedOpinionIds.push(child.postId);
+    if (!renderedOpinionIds.includes(child.postId)) {postCount = renderedOpinionIds.push(child.postId);}
     return (
       <div key={child.postId}>
@@ -158,5 +198,5 @@
               му реплицирал на {parentPostAuthorUsername}
             </p>
-            <p style={{ marginBottom: "10px", maxWidth: "90%" }}>
+            <p style={{ marginBottom: "10px", maxWidth: "85%" }}>
               {child.content}
             </p>
@@ -228,4 +268,11 @@
                 onClick={() => handleReply(child)}
               />
+
+              <StyledFontAwesomeIcon
+                  icon={solid("flag")}
+                  right={130 + "px"}
+                  color="darkgrey"
+                  onClick={() => handleReport(child)}
+              />
             </div>
           </OpinionReplyCardContent>
@@ -244,6 +291,6 @@
   return (
     <div className="opinionTree">
-      {professor.relatedOpinions.map((opinion) => {
-        if (!renderedOpinionIds.includes(opinion.postId)) {
+      {relatedOpinions.map((opinion) => {
+        if (!renderedOpinionIds.includes(opinion.postId) && opinion.parent === null) {
           postCount = renderedOpinionIds.push(opinion.postId);
           return (
@@ -257,5 +304,5 @@
                     напишал
                   </p>
-                  <p style={{ marginBottom: "10px", maxWidth: "90%" }}>
+                  <p style={{ marginBottom: "10px", maxWidth: "85%" }}>
                     {opinion.content}
                   </p>
@@ -335,4 +382,11 @@
                       onClick={() => handleReply(opinion)}
                     />
+
+                    <StyledFontAwesomeIcon
+                        icon={solid("flag")}
+                        right={130 + "px"}
+                        color="darkgrey"
+                        onClick={() => handleReport(opinion)}
+                    />
                   </div>
                 </OpinionCardContent>
@@ -346,5 +400,5 @@
         return null;
       })}
-      {postForModal && (
+      {postForReplyModal && (
         <Modal display={replyModalDisplay}>
           <ModalContent>
@@ -352,8 +406,8 @@
               <ModalClose onClick={handleModalCloseClick}>&times;</ModalClose>
               <h3 style={{ marginTop: "5px" }}>
-                Реплика на {postForModal.author.username}
+                Реплика на {postForReplyModal.author.username}
               </h3>
             </ModalHeader>
-            <form onSubmit={(e) => handleReplySubmit(e, postForModal.postId)}>
+            <form onSubmit={(e) => handleReplySubmit(e, postForReplyModal.postId)}>
               <ModalBody>
                 <label htmlFor="content">
@@ -364,5 +418,5 @@
                     cols="100"
                     value={replyContent}
-                    onChange={handleContentChange}
+                    onChange={handleReplyContentChange}
                     spellCheck={false}
                   />
@@ -379,4 +433,37 @@
         </Modal>
       )}
+      {postForReportModal && (
+          <Modal display={reportModalDisplay}>
+            <ModalContent>
+              <ModalHeader>
+                <ModalClose onClick={handleModalCloseClick}>&times;</ModalClose>
+                <h3 style={{ marginTop: "5px" }}>
+                  Пријава за мислење #{postForReportModal.postId}
+                </h3>
+              </ModalHeader>
+              <form onSubmit={(e) => handleReportSubmit(e, postForReportModal.postId)}>
+                <ModalBody>
+                  <label htmlFor="content">
+                    <b>Наведете причина</b>:
+                    <ModalTextarea
+                        id="content"
+                        rows="8"
+                        cols="100"
+                        value={reportContent}
+                        onChange={handleReportContentChange}
+                        spellCheck={false}
+                    />
+                  </label>
+                </ModalBody>
+                <p
+                    style={{ color: "red", marginLeft: "15px", marginTop: "10px" }}
+                >
+                  {errorMessage}
+                </p>
+                <ModalFooter type="submit">ПРИЈАВИ</ModalFooter>
+              </form>
+            </ModalContent>
+          </Modal>
+      )}
     </div>
   );
