@@ -7,7 +7,7 @@ import cn from 'classnames'
77import { markdownToHTML } from '../../helpers/markdownToState'
88import MediaQuery from 'react-responsive'
99import CommentMobile from '../ActionCard/CommentMobile'
10- import { SCREEN_BREAKPOINT_MD , POSTS_BUNDLE_TIME_DIFF } from '../../config/constants'
10+ import { SCREEN_BREAKPOINT_MD } from '../../config/constants'
1111
1212import './FeedComments.scss'
1313
@@ -61,7 +61,6 @@ class FeedComments extends React.Component {
6161 }
6262
6363 const desktopBlocks = [ ]
64- const mobileBlocks = [ ]
6564
6665 if ( hasMoreComments ) {
6766 desktopBlocks . push (
@@ -73,12 +72,10 @@ class FeedComments extends React.Component {
7372 )
7473 }
7574
76- comments && comments . forEach ( ( item , idx ) => {
75+ comments && comments . forEach ( ( item , idx ) => {
7776 const createdAt = moment ( item . createdAt )
7877 const prevComment = comments [ idx - 1 ]
79- const timeDiffPrevComment = prevComment && moment ( item . createdAt ) . diff ( prevComment . createdAt )
80- const isSameAuthor = prevComment && prevComment . author . userId === item . author . userId &&
81- timeDiffPrevComment && timeDiffPrevComment <= POSTS_BUNDLE_TIME_DIFF
78+ const isSameAuthor = prevComment && prevComment . author . userId === item . author . userId
8279 const isSameDay = prevComment && moment ( prevComment . createdAt ) . isSame ( createdAt , 'day' )
8380 const isFirstUnread = prevComment && ! prevComment . unread && item . unread
8481
@@ -103,7 +100,7 @@ class FeedComments extends React.Component {
103100 key = { idx }
104101 message = { item }
105102 author = { item . author }
106- date = { item . createdAt }
103+ date = { item . date }
107104 edited = { item . edited }
108105 active = { item . unread }
109106 self = { item . author && item . author . userId === currentUser . userId }
@@ -118,18 +115,6 @@ class FeedComments extends React.Component {
118115 < div dangerouslySetInnerHTML = { { __html : markdownToHTML ( item . content ) } } />
119116 </ Comment >
120117 )
121-
122- mobileBlocks . push (
123- < CommentMobile
124- key = { idx }
125- messageId = { item . id . toString ( ) }
126- author = { item . author }
127- date = { item . createdAt }
128- noInfo = { isSameAuthor }
129- >
130- < div dangerouslySetInnerHTML = { { __html : markdownToHTML ( item . content ) } } />
131- </ CommentMobile >
132- )
133118 } )
134119
135120 return (
@@ -164,7 +149,16 @@ class FeedComments extends React.Component {
164149 </ a >
165150 </ div >
166151 }
167- { mobileBlocks }
152+ { comments . map ( ( item , idx ) => (
153+ < CommentMobile
154+ key = { idx }
155+ messageId = { item . id . toString ( ) }
156+ author = { item . author }
157+ date = { item . date }
158+ >
159+ < div dangerouslySetInnerHTML = { { __html : markdownToHTML ( item . content ) } } />
160+ </ CommentMobile >
161+ ) ) }
168162 </ div >
169163 ) ) }
170164 </ MediaQuery >
0 commit comments