Ignore:
Timestamp:
07/30/22 23:57:30 (2 years ago)
Author:
unknown <mlviktor23@…>
Branches:
main
Children:
ad40ec0
Parents:
5347491
Message:

styled professor page

File:
1 edited

Legend:

Unmodified
Added
Removed
  • reactapp/src/Components/OpinionTree.js

    r5347491 rf5d4792  
    1 import { OpinionCard, OpinionReplyCard } from "./OpinionCard.style";
     1import {
     2  OpinionCard,
     3  OpinionCardContent,
     4  OpinionCardContentTime,
     5  OpinionCardContentTitle,
     6  OpinionReplyCard,
     7  OpinionReplyCardContent,
     8  OpinionReplyCardContentTime,
     9  StyledFontAwesomeIcon,
     10} from "./OpinionCard.style";
     11import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
     12import {
     13  solid,
     14  regular,
     15  brands,
     16} from "@fortawesome/fontawesome-svg-core/import.macro";
    217import { dateConverter } from "../Util/dateConverter";
    318
     
    1227      <div key={child.postId}>
    1328        <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          )}
    2257        </OpinionReplyCard>
    23         {child.children.map((childOfChild) =>
    24           displayChildPosts(
    25             childOfChild,
    26             child.author.username,
    27             replyIndent + 30
    28           )
    29         )}
    3058      </div>
    3159    );
     
    3765        if (!renderedOpinionIds.includes(opinion.postId)) {
    3866          postCount = renderedOpinionIds.push(opinion.postId);
    39           var replyIndent = 30;
    4067          return (
    4168            <div key={opinion.postId}>
    4269              <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                )}
    5499              </OpinionCard>
    55               {opinion.children.map((child) =>
    56                 displayChildPosts(child, opinion.author.username, replyIndent)
    57               )}
    58100            </div>
    59101          );
Note: See TracChangeset for help on using the changeset viewer.