Changes in reactapp/src/Pages/Topic.js [3b6962d:af801e3]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
reactapp/src/Pages/Topic.js
r3b6962d raf801e3 28 28 } from "../Components/Styled/Modal.style"; 29 29 import axios from "../api/axios"; 30 import LoadingSpinner from "../Components/Styled/LoadingSpinner.style"; 30 31 31 32 const Topic = () => { … … 48 49 49 50 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`; 52 53 53 54 const fetchTopic = async () => { … … 99 100 if (!replyContent.length < 1) { 100 101 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}`, 102 103 { 103 104 method: "post", … … 109 110 ); 110 111 setErrorMessage(""); 111 window.location.reload( false);112 window.location.reload(); 112 113 } else { 113 114 setErrorMessage("Полето за содржина не смее да биде празно"); … … 128 129 if (!postContent.length < 1) { 129 130 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}`, 131 132 { 132 133 method: "post", … … 138 139 ); 139 140 setErrorMessage(""); 140 window.location.reload( false);141 window.location.reload(); 141 142 } else { 142 143 setErrorMessage("Полето за содржина не смее да биде празно"); … … 160 161 ) { 161 162 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}`, 163 164 { 164 165 method: "get", … … 166 167 } 167 168 ); 168 window.location.reload( false);169 window.location.reload(); 169 170 } else { 170 171 return; … … 183 184 ) { 184 185 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}`, 186 187 { 187 188 method: "get", … … 190 191 ); 191 192 192 window.location.reload( false);193 window.location.reload(); 193 194 } else { 194 195 return; … … 213 214 {child.content} 214 215 </p> 215 { thread.timePosted === thread.timeLastEdited? (216 {new Date(child.timePosted).setMilliseconds(0) === new Date(child.timeLastEdited).setMilliseconds(0) ? ( 216 217 <OpinionCardContentTime> 217 218 {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> 220 221 </OpinionCardContentTime> 221 222 ) : ( 222 223 <OpinionCardContentTime> 223 224 {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>{" "} 226 227 (едитирано од модератор) 227 228 </OpinionCardContentTime> … … 270 271 /> 271 272 272 <VoteCount right={ 50 + "px"}>273 <VoteCount right={10 + "px"}> 273 274 {child.votes.filter((v) => v.vote === "DOWNVOTE").length} 274 275 </VoteCount> … … 324 325 </CurrentPageNav> 325 326 <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> 327 328 {auth && ( 328 329 <AddOpinionButton onClick={handleAddOpinionButtonClick}> … … 369 370 {thread.content} 370 371 </p> 371 { thread.timePosted === thread.timeLastEdited? (372 {new Date(thread.timePosted).setMilliseconds(0) === new Date(thread.timeLastEdited).setMilliseconds(0) ? ( 372 373 <OpinionCardContentTime> 373 374 {dateConverter( 374 375 new Date(thread.timePosted).toString().slice(4, -43) 375 )} 376 )} <span style={{fontStyle:"normal",color:"blue"}}>#{thread.postId}</span> 376 377 </OpinionCardContentTime> 377 378 ) : ( … … 379 380 {dateConverter( 380 381 new Date(thread.timeLastEdited).toString().slice(4, -43) 381 )}{" "} 382 )}{" "} <span style={{fontStyle:"normal",color:"blue"}}>#{thread.postId}</span>{" "} 382 383 (едитирано од модератор) 383 384 </OpinionCardContentTime> … … 444 445 {directChild.content} 445 446 </p> 446 { directChild.timePosted === directChild.timeLastEdited? (447 {new Date(directChild.timePosted).setMilliseconds(0) === new Date(directChild.timeLastEdited).setMilliseconds(0) ? ( 447 448 <OpinionCardContentTime> 448 449 {dateConverter( 449 450 new Date(directChild.timePosted).toString().slice(4, -43) 450 )} 451 )} <span style={{fontStyle:"normal",color:"blue"}}>#{directChild.postId}</span> 451 452 </OpinionCardContentTime> 452 453 ) : ( … … 456 457 .toString() 457 458 .slice(4, -43) 458 )}{" "} 459 )}{" "} <span style={{fontStyle:"normal",color:"blue"}}>#{directChild.postId}</span>{" "} 459 460 (едитирано од модератор) 460 461 </OpinionCardContentTime> … … 559 560 ) : !fetchError && !loadedThread ? ( 560 561 <div> 561 < p style={{ marginTop: "140px" }}>се вчитува...</p>562 <LoadingSpinner style={{ marginTop: "140px" }}/> 562 563 <Outlet /> 563 564 </div>
Note:
See TracChangeset
for help on using the changeset viewer.