From cd711b6c009d923fe187f7d62cd3ab8ac62b49b5 Mon Sep 17 00:00:00 2001 From: Mustafa Buyukcelebi Date: Mon, 14 Oct 2019 16:53:45 +0300 Subject: [PATCH] Added hide avatar images feature for comments --- src/components/comment/view/commentView.js | 2 ++ src/components/comments/container/commentsContainer.js | 2 ++ src/components/comments/view/commentsView.js | 2 ++ src/components/profile/profileView.js | 2 ++ src/containers/profileContainer.js | 4 +++- src/screens/profile/screen/profileScreen.js | 2 ++ 6 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/components/comment/view/commentView.js b/src/components/comment/view/commentView.js index 263e60a5b..650e91eef 100644 --- a/src/components/comment/view/commentView.js +++ b/src/components/comment/view/commentView.js @@ -60,6 +60,7 @@ class CommentView extends PureComponent { voteCount, intl, mainAuthor = { mainAuthor }, + isHideImage, } = this.props; const { isShowSubComments, isPressedShowButton } = this.state; @@ -74,6 +75,7 @@ class CommentView extends PureComponent { size={avatarSize || 24} currentAccountUsername={currentAccountUsername} isShowOwnerIndicator={mainAuthor === comment.author} + isHideImage={isHideImage} /> ); } diff --git a/src/components/comments/view/commentsView.js b/src/components/comments/view/commentsView.js index 7411eda4a..70f97332a 100644 --- a/src/components/comments/view/commentsView.js +++ b/src/components/comments/view/commentsView.js @@ -56,6 +56,7 @@ class CommentsView extends Component { handleOnVotersPress, intl, isOwnProfile, + isHideImage, } = this.props; const { selectedComment } = this.state; @@ -87,6 +88,7 @@ class CommentsView extends Component { handleOnReplyPress={handleOnReplyPress} handleOnUserPress={handleOnUserPress} handleOnVotersPress={handleOnVotersPress} + isHideImage={isHideImage} isLoggedIn={isLoggedIn} isShowMoreButton={commentNumber === 1 && get(item, 'children') > 0} voteCount={get(item, 'vote_count')} diff --git a/src/components/profile/profileView.js b/src/components/profile/profileView.js index 108cae6c8..03f86c0c5 100644 --- a/src/components/profile/profileView.js +++ b/src/components/profile/profileView.js @@ -82,6 +82,7 @@ class ProfileView extends PureComponent { selectedUser, username, votingPower, + isHideImage, } = this.props; const { @@ -195,6 +196,7 @@ class ProfileView extends PureComponent { comments={comments} fetchPost={getReplies} isOwnProfile={isOwnProfile} + isHideImage={isHideImage} /> ) : ( diff --git a/src/containers/profileContainer.js b/src/containers/profileContainer.js index 1a6205db0..dd09a5fde 100644 --- a/src/containers/profileContainer.js +++ b/src/containers/profileContainer.js @@ -331,7 +331,7 @@ class ProfileContainer extends Component { user, username, } = this.state; - const { currency, isDarkTheme, isLoggedIn, navigation, children } = this.props; + const { currency, isDarkTheme, isLoggedIn, navigation, children, isHideImage } = this.props; const activePage = get(navigation.state.params, 'state', 0); const { currencyRate, currencySymbol } = currency; @@ -370,6 +370,7 @@ class ProfileContainer extends Component { isDarkTheme, isFavorite, isFollowing, + isHideImage, isLoggedIn, isMuted, isOwnProfile, @@ -390,6 +391,7 @@ const mapStateToProps = state => ({ pinCode: state.application.pin, activeBottomTab: state.ui.activeBottomTab, currentAccount: state.account.currentAccount, + isHideImage: state.ui.hidePostsThumbnails, }); export default connect(mapStateToProps)(withNavigation(ProfileContainer)); diff --git a/src/screens/profile/screen/profileScreen.js b/src/screens/profile/screen/profileScreen.js index aeddf8a86..6b3b1b79b 100644 --- a/src/screens/profile/screen/profileScreen.js +++ b/src/screens/profile/screen/profileScreen.js @@ -27,6 +27,7 @@ const ProfileScreen = () => ( isDarkTheme, isFavorite, isFollowing, + isHideImage, isLoggedIn, isMuted, isOwnProfile, @@ -72,6 +73,7 @@ const ProfileScreen = () => ( setEstimatedWalletValue={setEstimatedWalletValue} username={username} votingPower={votingPower} + isHideImage={isHideImage} /> )}