disabled own profile press

This commit is contained in:
u-e 2019-05-11 17:16:00 +03:00
parent bd4845ace0
commit 8cd179e4bd
5 changed files with 24 additions and 15 deletions

View File

@ -67,6 +67,7 @@ class CommentView extends PureComponent {
name={comment.author} name={comment.author}
reputation={comment.author_reputation} reputation={comment.author_reputation}
size={avatarSize || 24} size={avatarSize || 24}
currentAccountUsername={currentAccountUsername}
isShowOwnerIndicator={currentAccountUsername === comment.author} isShowOwnerIndicator={currentAccountUsername === comment.author}
/> />
<View style={[{ marginLeft: marginLeft || 29 }, styles.bodyWrapper]}> <View style={[{ marginLeft: marginLeft || 29 }, styles.bodyWrapper]}>

View File

@ -33,19 +33,26 @@ class PostHeaderDescription extends PureComponent {
// Component Functions // Component Functions
_handleOnUserPress = (username) => { _handleOnUserPress = (username) => {
const { navigation, profileOnPress, reputation } = this.props; const {
navigation,
profileOnPress,
reputation,
currentAccountUsername,
} = this.props;
if (profileOnPress) { if (currentAccountUsername !== username) {
profileOnPress(username); if (profileOnPress) {
} else { profileOnPress(username);
navigation.navigate({ } else {
routeName: ROUTES.SCREENS.PROFILE, navigation.navigate({
params: { routeName: ROUTES.SCREENS.PROFILE,
username, params: {
reputation, username,
}, reputation,
key: username, },
}); key: username,
});
}
} }
}; };

View File

@ -73,7 +73,7 @@ class PostDisplayContainer extends Component {
_fetchPost = async () => { _fetchPost = async () => {
const { post, fetchPost } = this.props; const { post, fetchPost } = this.props;
fetchPost(post.author, post.permlink); if (post) fetchPost(post.author, post.permlink);
}; };
render() { render() {

View File

@ -122,7 +122,7 @@ class PostDisplayView extends PureComponent {
}; };
render() { render() {
const { post, fetchPost, parentPost } = this.props; const { post, fetchPost, parentPost, currentAccount: { name } } = this.props;
const { postHeight, scrollHeight, isLoadedComments } = this.state; const { postHeight, scrollHeight, isLoadedComments } = this.state;
// const isPostEnd = scrollHeight > postHeight; // const isPostEnd = scrollHeight > postHeight;
@ -145,6 +145,7 @@ class PostDisplayView extends PureComponent {
<PostHeaderDescription <PostHeaderDescription
date={formatedTime} date={formatedTime}
name={post.author} name={post.author}
currentAccountUsername={name}
reputation={post.author_reputation} reputation={post.author_reputation}
tag={post.category} tag={post.category}
size={16} size={16}

View File

@ -289,7 +289,7 @@ class PostsView extends Component {
titleColor="#fff" titleColor="#fff"
colors={['#fff']} colors={['#fff']}
/> />
)} )}
ref={(ref) => { ref={(ref) => {
this.flatList = ref; this.flatList = ref;
}} }}