- Timestamp:
- 07/30/22 21:53:22 (2 years ago)
- Branches:
- main
- Children:
- f5d4792
- Parents:
- e958037
- Location:
- reactapp
- Files:
-
- 1 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
reactapp/package-lock.json
re958037 r5347491 16 16 "@testing-library/react": "^13.3.0", 17 17 "@testing-library/user-event": "^13.5.0", 18 "babel": "^6.23.0", 18 19 "babel-plugin-macros": "^3.1.0", 19 20 "jsog": "^1.0.7", … … 4875 4876 "integrity": "sha512-Td525n+iPOOyUQIeBfcASuG6uJsDOITl7Mds5gFyerkWiX7qhUTdYUBlSgNMyVqtSJqwpt1kXGLdUt6SykLMRA==" 4876 4877 }, 4878 "node_modules/babel": { 4879 "version": "6.23.0", 4880 "resolved": "https://registry.npmjs.org/babel/-/babel-6.23.0.tgz", 4881 "integrity": "sha512-ZDcCaI8Vlct8PJ3DvmyqUz+5X2Ylz3ZuuItBe/74yXosk2dwyVo/aN7MCJ8HJzhnnJ+6yP4o+lDgG9MBe91DLA==", 4882 "deprecated": "In 6.x, the babel package has been deprecated in favor of babel-cli. Check https://opencollective.com/babel to support the Babel maintainers", 4883 "bin": { 4884 "babel": "lib/cli.js", 4885 "babel-external-helpers": "lib/cli.js", 4886 "babel-node": "lib/cli.js" 4887 } 4888 }, 4877 4889 "node_modules/babel-jest": { 4878 4890 "version": "27.5.1", … … 20312 20324 "integrity": "sha512-Td525n+iPOOyUQIeBfcASuG6uJsDOITl7Mds5gFyerkWiX7qhUTdYUBlSgNMyVqtSJqwpt1kXGLdUt6SykLMRA==" 20313 20325 }, 20326 "babel": { 20327 "version": "6.23.0", 20328 "resolved": "https://registry.npmjs.org/babel/-/babel-6.23.0.tgz", 20329 "integrity": "sha512-ZDcCaI8Vlct8PJ3DvmyqUz+5X2Ylz3ZuuItBe/74yXosk2dwyVo/aN7MCJ8HJzhnnJ+6yP4o+lDgG9MBe91DLA==" 20330 }, 20314 20331 "babel-jest": { 20315 20332 "version": "27.5.1", -
reactapp/package.json
re958037 r5347491 11 11 "@testing-library/react": "^13.3.0", 12 12 "@testing-library/user-event": "^13.5.0", 13 "babel": "^6.23.0", 13 14 "babel-plugin-macros": "^3.1.0", 14 15 "jsog": "^1.0.7", -
reactapp/src/Components/OpinionCard.style.js
re958037 r5347491 5 5 width: fit-content; 6 6 `; 7 8 export const OpinionReplyCard = styled.div` 9 background-color: lavender; 10 width: fit-content; 11 margin-top: 7px; 12 margin-bottom: 7px; 13 margin-left: ${(props) => props.indent}; 14 `; -
reactapp/src/Components/OpinionTree.js
re958037 r5347491 1 import { OpinionCard } from "./OpinionCard.style"; 1 import { OpinionCard, OpinionReplyCard } from "./OpinionCard.style"; 2 import { dateConverter } from "../Util/dateConverter"; 2 3 3 4 function OpinionTree({ professor }) { … … 5 6 var postCount; // za da ne go pokazuva ispod postot 6 7 7 function displayChildPosts(child ) {8 function displayChildPosts(child, parentPostAuthorUsername, replyIndent) { 8 9 if (child == null) return; 9 10 postCount = renderedOpinionIds.push(child.postId); 10 11 return ( 11 12 <div key={child.postId}> 12 <p> 13 <a href="#">{child.author.username}</a> реплицирал 14 </p> 15 <p>Содржина: {child.content}</p> 16 {child.children.map((childOfChild) => displayChildPosts(childOfChild))} 13 <OpinionReplyCard indent={replyIndent + "px"}> 14 <p> 15 <a href="#">{child.author.username}</a> му реплицирал на{" "} 16 {parentPostAuthorUsername} 17 </p> 18 <p>{child.content}</p> 19 <p> 20 {dateConverter(new Date(child.timePosted).toString().slice(4, -43))} 21 </p> 22 </OpinionReplyCard> 23 {child.children.map((childOfChild) => 24 displayChildPosts( 25 childOfChild, 26 child.author.username, 27 replyIndent + 30 28 ) 29 )} 17 30 </div> 18 31 ); … … 24 37 if (!renderedOpinionIds.includes(opinion.postId)) { 25 38 postCount = renderedOpinionIds.push(opinion.postId); 39 var replyIndent = 30; 26 40 return ( 27 41 <div key={opinion.postId}> … … 33 47 <p>{opinion.title}</p> 34 48 <p>{opinion.content}</p> 35 <p>{Date(opinion.timePosted)}</p> 49 <p> 50 {dateConverter( 51 new Date(opinion.timePosted).toString().slice(4, -43) 52 )} 53 </p> 36 54 </OpinionCard> 37 {opinion.children.map((child) => displayChildPosts(child))} 55 {opinion.children.map((child) => 56 displayChildPosts(child, opinion.author.username, replyIndent) 57 )} 38 58 </div> 39 59 ); -
reactapp/src/Pages/Professor.js
re958037 r5347491 48 48 <ProfessorCardName>{professor.professorName}</ProfessorCardName> 49 49 <ProfessorCardSeparator /> 50 <div style={{ marginTop: " 20px" }}>50 <div style={{ marginTop: "10px" }}> 51 51 <ProfessorCardDetails fontSize="20px"> 52 52 {professor.faculty.facultyName}
Note:
See TracChangeset
for help on using the changeset viewer.