Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • reactapp/src/Pages/Topic.js

    r3b6962d raf801e3  
    2828} from "../Components/Styled/Modal.style";
    2929import axios from "../api/axios";
     30import LoadingSpinner from "../Components/Styled/LoadingSpinner.style";
    3031
    3132const Topic = () => {
     
    4849
    4950  useEffect(() => {
    50     const url1 = `http://192.168.0.19:8080/public/thread/${params.topicId}`;
    51     const url2 = `http://192.168.0.19:8080/secure/currentUser`;
     51    const url1 = `http://192.168.0.29:8080/public/thread/${params.topicId}`;
     52    const url2 = `http://192.168.0.29:8080/secure/currentUser`;
    5253
    5354    const fetchTopic = async () => {
     
    99100    if (!replyContent.length < 1) {
    100101      const response = await axios(
    101         `http://192.168.0.19:8080/secure/subject/${thread.targetSubject.subjectId}/replyToThread/${postId}`,
     102        `http://192.168.0.29:8080/secure/subject/${thread.targetSubject.subjectId}/replyToThread/${postId}`,
    102103        {
    103104          method: "post",
     
    109110      );
    110111      setErrorMessage("");
    111       window.location.reload(false);
     112      window.location.reload();
    112113    } else {
    113114      setErrorMessage("Полето за содржина не смее да биде празно");
     
    128129    if (!postContent.length < 1) {
    129130      const response = await axios(
    130         `http://192.168.0.19:8080/secure/subject/${thread.targetSubject.subjectId}/replyToThread/${params.topicId}`,
     131        `http://192.168.0.29:8080/secure/subject/${thread.targetSubject.subjectId}/replyToThread/${params.topicId}`,
    131132        {
    132133          method: "post",
     
    138139      );
    139140      setErrorMessage("");
    140       window.location.reload(false);
     141      window.location.reload();
    141142    } else {
    142143      setErrorMessage("Полето за содржина не смее да биде празно");
     
    160161      ) {
    161162        const response = await axios(
    162           `http://192.168.0.19:8080/secure/upvoteThread/${post.postId}`,
     163          `http://192.168.0.29:8080/secure/upvoteThread/${post.postId}`,
    163164          {
    164165            method: "get",
     
    166167          }
    167168        );
    168         window.location.reload(false);
     169        window.location.reload();
    169170      } else {
    170171        return;
     
    183184      ) {
    184185        const response = await axios(
    185           `http://192.168.0.19:8080/secure/downvoteThread/${post.postId}`,
     186          `http://192.168.0.29:8080/secure/downvoteThread/${post.postId}`,
    186187          {
    187188            method: "get",
     
    190191        );
    191192
    192         window.location.reload(false);
     193        window.location.reload();
    193194      } else {
    194195        return;
     
    213214              {child.content}
    214215            </p>
    215             {thread.timePosted === thread.timeLastEdited ? (
     216            {new Date(child.timePosted).setMilliseconds(0) === new Date(child.timeLastEdited).setMilliseconds(0) ? (
    216217              <OpinionCardContentTime>
    217218                {dateConverter(
    218                   new Date(thread.timePosted).toString().slice(4, -43)
    219                 )}
     219                  new Date(child.timePosted).toString().slice(4, -43)
     220                )} <span style={{fontStyle:"normal",color:"blue"}}>#{child.postId}</span>
    220221              </OpinionCardContentTime>
    221222            ) : (
    222223              <OpinionCardContentTime>
    223224                {dateConverter(
    224                   new Date(thread.timeLastEdited).toString().slice(4, -43)
    225                 )}{" "}
     225                  new Date(child.timeLastEdited).toString().slice(4, -43)
     226                )}{" "} <span style={{fontStyle:"normal",color:"blue"}}>#{child.postId}</span>{" "}
    226227                (едитирано од модератор)
    227228              </OpinionCardContentTime>
     
    270271              />
    271272
    272               <VoteCount right={50 + "px"}>
     273              <VoteCount right={10 + "px"}>
    273274                {child.votes.filter((v) => v.vote === "DOWNVOTE").length}
    274275              </VoteCount>
     
    324325      </CurrentPageNav>
    325326      <div style={{ height: "20px", marginBottom: "50px", marginTop: "50px" }}>
    326         <h3 style={{ float: "left" }}>{thread.title}</h3>
     327        <h3 style={{ float: "left" }}>{thread.title} <span style={{opacity:"50%", fontSize:"16px"}}>#{thread.postId}</span></h3>
    327328        {auth && (
    328329          <AddOpinionButton onClick={handleAddOpinionButtonClick}>
     
    369370            {thread.content}
    370371          </p>
    371           {thread.timePosted === thread.timeLastEdited ? (
     372          {new Date(thread.timePosted).setMilliseconds(0) === new Date(thread.timeLastEdited).setMilliseconds(0) ? (
    372373            <OpinionCardContentTime>
    373374              {dateConverter(
    374375                new Date(thread.timePosted).toString().slice(4, -43)
    375               )}
     376              )} <span style={{fontStyle:"normal",color:"blue"}}>#{thread.postId}</span>
    376377            </OpinionCardContentTime>
    377378          ) : (
     
    379380              {dateConverter(
    380381                new Date(thread.timeLastEdited).toString().slice(4, -43)
    381               )}{" "}
     382              )}{" "} <span style={{fontStyle:"normal",color:"blue"}}>#{thread.postId}</span>{" "}
    382383              (едитирано од модератор)
    383384            </OpinionCardContentTime>
     
    444445                {directChild.content}
    445446              </p>
    446               {directChild.timePosted === directChild.timeLastEdited ? (
     447              {new Date(directChild.timePosted).setMilliseconds(0) === new Date(directChild.timeLastEdited).setMilliseconds(0) ? (
    447448                <OpinionCardContentTime>
    448449                  {dateConverter(
    449450                    new Date(directChild.timePosted).toString().slice(4, -43)
    450                   )}
     451                  )} <span style={{fontStyle:"normal",color:"blue"}}>#{directChild.postId}</span>
    451452                </OpinionCardContentTime>
    452453              ) : (
     
    456457                      .toString()
    457458                      .slice(4, -43)
    458                   )}{" "}
     459                  )}{" "} <span style={{fontStyle:"normal",color:"blue"}}>#{directChild.postId}</span>{" "}
    459460                  (едитирано од модератор)
    460461                </OpinionCardContentTime>
     
    559560  ) : !fetchError && !loadedThread ? (
    560561    <div>
    561       <p style={{ marginTop: "140px" }}>се вчитува...</p>
     562      <LoadingSpinner style={{ marginTop: "140px" }}/>
    562563      <Outlet />
    563564    </div>
Note: See TracChangeset for help on using the changeset viewer.