diff --git a/src/components/comment/view/commentView.tsx b/src/components/comment/view/commentView.tsx index 301d5e2013..dbb7071612 100644 --- a/src/components/comment/view/commentView.tsx +++ b/src/components/comment/view/commentView.tsx @@ -77,7 +77,7 @@ const CommentView = ({ const _handleOnReplyPress = () => { if (isLoggedIn) { - dispatch(showReplyModal({mode:'comment', parentPost:comment})); + dispatch(showReplyModal({ mode: 'comment', parentPost: comment })); } else { console.log('Not LoggedIn'); } @@ -97,11 +97,16 @@ const CommentView = ({ ); const _renderComment = () => { + + const _hideContent = isMuted || comment.author_reputation < 25 || comment.net_rshares < 0; + return ( handleOnLongPress(comment)} @@ -109,9 +114,6 @@ const CommentView = ({ handleImagePress={handleImagePress} handleVideoPress={handleVideoPress} handleYoutubePress={handleYoutubePress} - body={comment.body} - key={`key-${comment.permlink}`} - isMuted={isMuted} /> @@ -216,9 +218,9 @@ const CommentView = ({ const customContainerStyle = _depth > 1 ? { - paddingLeft: (_depth - 2) * 44, - backgroundColor: EStyleSheet.value('$primaryLightBackground'), - } + paddingLeft: (_depth - 2) * 44, + backgroundColor: EStyleSheet.value('$primaryLightBackground'), + } : null; return ( diff --git a/src/components/postElements/body/view/commentBodyView.tsx b/src/components/postElements/body/view/commentBodyView.tsx index c256f7ed20..96f878eeb3 100644 --- a/src/components/postElements/body/view/commentBodyView.tsx +++ b/src/components/postElements/body/view/commentBodyView.tsx @@ -22,8 +22,24 @@ import getWindowDimensions from '../../../../utils/getWindowDimensions'; const WIDTH = getWindowDimensions().width; +interface CommentBodyProps { + body: string; + commentDepth: number; + hideContent: boolean; + handleOnContentPress: () => void; + handleOnUserPress: () => void; + handleOnPostPress: () => void; + handleOnLongPress: () => void; + handleVideoPress: () => void; + handleYoutubePress: () => void; + handleImagePress: () => void; + handleLinkPress: () => void; +} + const CommentBody = ({ body, + commentDepth, + hideContent, handleOnContentPress, handleOnUserPress, handleOnPostPress, @@ -32,15 +48,12 @@ const CommentBody = ({ handleYoutubePress, handleImagePress, handleLinkPress, - commentDepth, - reputation = 25, - isMuted, -}) => { +}: CommentBodyProps) => { const _contentWidth = WIDTH - (40 + 28 + (commentDepth > 2 ? 44 : 0)); const dispatch = useAppDispatch(); - const [revealComment, setRevealComment] = useState(reputation > 0 && !isMuted); + const [revealComment, setRevealComment] = useState(!hideContent); const intl = useIntl(); diff --git a/src/config/locales/en-US.json b/src/config/locales/en-US.json index cfaf8da910..987431eb4f 100644 --- a/src/config/locales/en-US.json +++ b/src/config/locales/en-US.json @@ -915,7 +915,7 @@ }, "comments": { "title": "Comments", - "reveal_comment": "Reveal comment", + "reveal_comment": "Reveal Content", "read_more": "Read more comments", "more_replies": "replies", "no_comments":"Be the first to respond..." diff --git a/src/utils/postParser.tsx b/src/utils/postParser.tsx index 73bdeebdbf..7d277ef2e1 100644 --- a/src/utils/postParser.tsx +++ b/src/utils/postParser.tsx @@ -345,7 +345,8 @@ export const injectVoteCache = (post, voteCache) => { const _oldReward = calculateVoteReward(_vote.rshares, post); //update total payout - post.total_payout += voteCache.amount - _oldReward; + const _voteAmount = voteCache.amount * (voteCache.isDownvote ? -1 : 1); + post.total_payout += _voteAmount - _oldReward //update vote entry _vote.rshares = voteCache.rshares