|
@@ -6,11 +6,15 @@ import './my posts.css';
|
|
|
|
|
|
function MyPosts() {
|
|
|
|
|
|
- let postData = [
|
|
|
+ let post = [
|
|
|
{id: 1, message: 'Hi, how are you?', likesCount: 12},
|
|
|
- {id: 2, message: 'My first post', likesCount: 9}
|
|
|
+ {id: 2, message: 'My first post', likesCount: 9},
|
|
|
+ {id: 2, message: 'Bla Bla Bla', likesCount: 9},
|
|
|
+ {id: 2, message: 'Say you\'ll haunt me', likesCount: 9}
|
|
|
]
|
|
|
|
|
|
+ let postsElements = post.map( p => <Post message={ p.message } likesCount={ p.likesCount } />)
|
|
|
+
|
|
|
return(
|
|
|
<div className="myposts-block">
|
|
|
My posts
|
|
@@ -24,8 +28,7 @@ function MyPosts() {
|
|
|
</div>
|
|
|
|
|
|
<div>
|
|
|
- <Post message={ postData[0].message } likesCount={ postData[0].likesCount } />
|
|
|
- <Post message={ postData[1].message } likesCount={ postData[1].likesCount } />
|
|
|
+ { postsElements }
|
|
|
</div>
|
|
|
</div>
|
|
|
)
|