hiding profile content if user is muted

This commit is contained in:
noumantahir 2021-09-21 20:05:11 +05:00
parent 821abf66b6
commit 7ebe197d61
2 changed files with 24 additions and 2 deletions

View File

@ -8,6 +8,12 @@ export default EStyleSheet.create({
content: { content: {
backgroundColor: '$primaryGrayBackground', backgroundColor: '$primaryGrayBackground',
}, },
mutedView: {
flex: 1,
backgroundColor: '$primaryLightBackground',
alignItems: 'center',
marginTop: 72,
},
cover: { cover: {
width: '$deviceWidth', width: '$deviceWidth',
height: 160, height: 160,

View File

@ -5,6 +5,7 @@ import get from 'lodash/get';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
// Components // Components
import EStyleSheet from 'react-native-extended-stylesheet';
import { CollapsibleCard } from '../collapsibleCard'; import { CollapsibleCard } from '../collapsibleCard';
import { Comments } from '../comments'; import { Comments } from '../comments';
import { Header } from '../header'; import { Header } from '../header';
@ -23,6 +24,7 @@ import styles from './profileStyles';
import { TabbedPosts } from '../tabbedPosts'; import { TabbedPosts } from '../tabbedPosts';
import CommentsTabContent from './children/commentsTabContent'; import CommentsTabContent from './children/commentsTabContent';
import { Icon } from '..';
class ProfileView extends PureComponent { class ProfileView extends PureComponent {
constructor(props) { constructor(props) {
@ -248,12 +250,26 @@ class ProfileView extends PureComponent {
); );
}; };
_renderMutedView = () => {
return (
<View style={styles.mutedView}>
<Icon
iconType="MaterialCommunityIcons"
name="volume-variant-off"
size={120}
color={EStyleSheet.value('$iconColor')}
disabled={true}
/>
</View>
);
};
_isCloseToBottom({ layoutMeasurement, contentOffset, contentSize }) { _isCloseToBottom({ layoutMeasurement, contentOffset, contentSize }) {
return layoutMeasurement.height + contentOffset.y >= contentSize.height - 20; return layoutMeasurement.height + contentOffset.y >= contentSize.height - 20;
} }
render() { render() {
const { handleOnBackPress, isOwnProfile, quickProfile, reverseHeader } = this.props; const { handleOnBackPress, quickProfile, reverseHeader, isMuted } = this.props;
return ( return (
<View style={styles.container}> <View style={styles.container}>
@ -265,7 +281,7 @@ class ProfileView extends PureComponent {
/> />
<View style={styles.container}> <View style={styles.container}>
{this._renderProfileContent()} {this._renderProfileContent()}
{this._renderTabs()} {!isMuted ? this._renderTabs() : this._renderMutedView()}
</View> </View>
</View> </View>
); );