comments yo
This commit is contained in:
mgabdev
2020-05-05 01:16:01 -04:00
parent 498f163880
commit 01bb440385
19 changed files with 234 additions and 73 deletions

View File

@@ -12,21 +12,21 @@ export default class CommentList extends ImmutablePureComponent {
commentsLimited: PropTypes.bool,
descendants: ImmutablePropTypes.list,
onViewComments: PropTypes.func.isRequired,
ancestorAccountId: PropTypes.string.isRequired,
}
render() {
const {
descendants,
commentsLimited,
onViewComments
onViewComments,
ancestorAccountId
} = this.props
const size = descendants.size
const upperLimit = commentsLimited ? 6 : size
const max = Math.min(commentsLimited ? 2 : upperLimit, size)
console.log("size, max:", size, max)
const Wrapper = !commentsLimited ? ScrollableList : DummyContainer
return (
@@ -37,7 +37,9 @@ export default class CommentList extends ImmutablePureComponent {
<Comment
key={`comment-${descendant.get('statusId')}-${i}`}
id={descendant.get('statusId')}
ancestorAccountId={ancestorAccountId}
indent={descendant.get('indent')}
isHighlighted={descendant.get('isHighlighted')}
/>
))
}