Changeset f5d4792 for reactapp/src/Components/OpinionTree.js
- Timestamp:
- 07/30/22 23:57:30 (2 years ago)
- Branches:
- main
- Children:
- ad40ec0
- Parents:
- 5347491
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
reactapp/src/Components/OpinionTree.js
r5347491 rf5d4792 1 import { OpinionCard, OpinionReplyCard } from "./OpinionCard.style"; 1 import { 2 OpinionCard, 3 OpinionCardContent, 4 OpinionCardContentTime, 5 OpinionCardContentTitle, 6 OpinionReplyCard, 7 OpinionReplyCardContent, 8 OpinionReplyCardContentTime, 9 StyledFontAwesomeIcon, 10 } from "./OpinionCard.style"; 11 import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; 12 import { 13 solid, 14 regular, 15 brands, 16 } from "@fortawesome/fontawesome-svg-core/import.macro"; 2 17 import { dateConverter } from "../Util/dateConverter"; 3 18 … … 12 27 <div key={child.postId}> 13 28 <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> 29 <OpinionReplyCardContent> 30 <p> 31 <a href="#">{child.author.username}</a> му реплицирал на{" "} 32 {parentPostAuthorUsername} 33 </p> 34 <p>{child.content}</p> 35 <OpinionReplyCardContentTime> 36 {dateConverter( 37 new Date(child.timePosted).toString().slice(4, -43) 38 )} 39 </OpinionReplyCardContentTime> 40 <StyledFontAwesomeIcon 41 icon={solid("thumbs-up")} 42 right={50 + "px"} 43 /> 44 <StyledFontAwesomeIcon 45 icon={solid("thumbs-down")} 46 right={10 + "px"} 47 /> 48 <StyledFontAwesomeIcon icon={solid("reply")} right={90 + "px"} /> 49 </OpinionReplyCardContent> 50 {child.children.map((childOfChild) => 51 displayChildPosts( 52 childOfChild, 53 child.author.username, 54 replyIndent + 30 55 ) 56 )} 22 57 </OpinionReplyCard> 23 {child.children.map((childOfChild) =>24 displayChildPosts(25 childOfChild,26 child.author.username,27 replyIndent + 3028 )29 )}30 58 </div> 31 59 ); … … 37 65 if (!renderedOpinionIds.includes(opinion.postId)) { 38 66 postCount = renderedOpinionIds.push(opinion.postId); 39 var replyIndent = 30;40 67 return ( 41 68 <div key={opinion.postId}> 42 69 <OpinionCard> 43 <p> 44 <a href="#">{opinion.author.username}</a> напишал 45 </p> 46 47 <p>{opinion.title}</p> 48 <p>{opinion.content}</p> 49 <p> 50 {dateConverter( 51 new Date(opinion.timePosted).toString().slice(4, -43) 52 )} 53 </p> 70 <OpinionCardContent> 71 <p> 72 <a href="#">{opinion.author.username}</a> напишал 73 </p> 74 <OpinionCardContentTitle> 75 {opinion.title} 76 </OpinionCardContentTitle> 77 <p>{opinion.content}</p> 78 <OpinionCardContentTime> 79 {dateConverter( 80 new Date(opinion.timePosted).toString().slice(4, -43) 81 )} 82 </OpinionCardContentTime> 83 <StyledFontAwesomeIcon 84 icon={solid("thumbs-up")} 85 right={50 + "px"} 86 /> 87 <StyledFontAwesomeIcon 88 icon={solid("thumbs-down")} 89 right={10 + "px"} 90 /> 91 <StyledFontAwesomeIcon 92 icon={solid("reply")} 93 right={90 + "px"} 94 /> 95 </OpinionCardContent> 96 {opinion.children.map((child) => 97 displayChildPosts(child, opinion.author.username, 30) 98 )} 54 99 </OpinionCard> 55 {opinion.children.map((child) =>56 displayChildPosts(child, opinion.author.username, replyIndent)57 )}58 100 </div> 59 101 );
Note:
See TracChangeset
for help on using the changeset viewer.