Repository navigation
Expand file tree
/
Copy pathPost.js
More file actions
45 lines (43 loc) · 1.54 KB
/
Copy pathPost.js
File metadata and controls
45 lines (43 loc) · 1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import React, { forwardRef } from "react";
import "./Post.css";
import { Avatar } from "@material-ui/core";
import VerifiedUserIcon from "@material-ui/icons/VerifiedUser";
import ChatBubbleOutlineIcon from "@material-ui/icons/ChatBubbleOutline";
import RepeatIcon from "@material-ui/icons/Repeat";
import FavoriteBorderIcon from "@material-ui/icons/FavoriteBorder";
import PublishIcon from "@material-ui/icons/Publish";
const Post = forwardRef(
({ displayName, username, verified, text, image, avatar }, ref) => {
return (
<div className="post" ref={ref}>
<div className="post__avatar">
<Avatar src={avatar} />
</div>
<div className="post__body">
<div className="post__header">
<div className="post__headerText">
<h3>
{displayName}{" "}
<span className="post__headerSpecial">
{verified && <VerifiedUserIcon className="post__badge" />}@{" "}
{username}
</span>
</h3>
</div>
<div className="post__headerDescription">
<p>{text}</p>
</div>
</div>
<img src={image} />
<div className="post__footer">
<ChatBubbleOutlineIcon fontSize="small" />
<RepeatIcon fontSize="small" />
<FavoriteBorderIcon fontSize="small" />
<PublishIcon fontSize="small" />
</div>
</div>
</div>
);
}
);
export default Post;