hiding muted user's comments

This commit is contained in:
noumantahir 2021-09-21 00:56:39 +05:00
parent 505fccd458
commit edbcc4f1d6
2 changed files with 10 additions and 4 deletions

View File

@ -17,7 +17,7 @@ import { TextWithIcon } from '../../basicUIElements';
// Styles
import styles from './commentStyles';
import Animated from 'react-native-reanimated';
import { useAppSelector } from '../../../hooks';
const CommentView = ({
avatarSize,
@ -41,12 +41,16 @@ const CommentView = ({
hideManyCommentsButton,
openReplyThread,
}) => {
const intl = useIntl();
const actionSheet = useRef(null);
const isMuted = useAppSelector(state => state.account.currentAccount.mutes?.indexOf(comment.author) > -1);
const [_isShowSubComments, setIsShowSubComments] = useState(isShowSubComments || false);
const [isPressedShowButton, setIsPressedShowButton] = useState(false);
const [activeVotes, setActiveVotes] = useState([]);
const intl = useIntl();
const actionSheet = useRef(null);
useEffect(() => {
if (comment) {
@ -119,6 +123,7 @@ const CommentView = ({
body={comment.body}
created={comment.created}
key={`key-${comment.permlink}`}
isMuted={isMuted}
/>
<Fragment>

View File

@ -38,6 +38,7 @@ const CommentBody = ({
commentDepth,
reputation,
dispatch,
isMuted
}) => {
const _contentWidth = WIDTH - (40 + 28 + (commentDepth > 2 ? 44 : 0))
@ -46,7 +47,7 @@ const CommentBody = ({
const [postImages, setPostImages] = useState<string[]>([]);
const [selectedImage, setSelectedImage] = useState(null);
const [selectedLink, setSelectedLink] = useState(null);
const [revealComment, setRevealComment] = useState(reputation > 0);
const [revealComment, setRevealComment] = useState(reputation > 0 && !isMuted);
const [videoUrl, setVideoUrl] = useState(null);
const [youtubeVideoId, setYoutubeVideoId] = useState(null)