File tree Expand file tree Collapse file tree 4 files changed +27
-4
lines changed
Expand file tree Collapse file tree 4 files changed +27
-4
lines changed Original file line number Diff line number Diff line change 108108 "body" : " Comment 1" ,
109109 "postId" : 1
110110 },
111+ {
112+ "id" : 2 ,
113+ "body" : " Comment 2" ,
114+ "postId" : 1
115+ },
111116 {
112117 "id" : 3 ,
113118 "body" : " Comment 3" ,
Original file line number Diff line number Diff line change @@ -60,10 +60,14 @@ export default function PostDetails() {
6060
6161 { post . comments . length > 0 &&
6262 < Fragment >
63- < h3 > Comments</ h3 >
63+ < h2 > Comments</ h2 >
6464
6565 { post . comments . map ( ( comment , index ) => {
66- return < p > { comment . body } </ p >
66+ return (
67+ < div key = { index } className = "post-comments" >
68+ < p > { comment . body } </ p >
69+ </ div >
70+ )
6771 } ) }
6872 </ Fragment >
6973 }
Original file line number Diff line number Diff line change @@ -42,7 +42,9 @@ export default function PostsList(props) {
4242 Read More
4343 </ Button >
4444 { post . comments . length > 0 &&
45- < p className = "card-comments" > ({ post . comments . length } ) Comment(s)</ p >
45+ < div className = "post-comments" >
46+ < p > ({ post . comments . length } ) Comment(s)</ p >
47+ </ div >
4648 }
4749 </ div >
4850 </ Card >
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import styled from '@xstyled/styled-components'
33const Card = styled . div `
44 background-color: secondaryColor !important;
55 border-radius: defaultRadius;
6+ border: none !important;
67 text-align: center;
78 margin: 0 0 15px 0;
89
@@ -44,8 +45,19 @@ const Card = styled.div`
4445 color: primaryColor;
4546 }
4647
47- .card -comments {
48+ .post -comments {
4849 text-align: center;
50+ padding: 15px;
51+ border-bottom: 1px solid #dedede;
52+
53+ &:last-child {
54+ border: none;
55+ padding: 15px 15px 0 15px;
56+ }
57+
58+ p {
59+ text-align: center;
60+ }
4961 }
5062 }
5163`
You can’t perform that action at this time.
0 commit comments