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}
reputation={comment.author_reputation}
size={avatarSize || 24}
currentAccountUsername={currentAccountUsername}
isShowOwnerIndicator={currentAccountUsername === comment.author}
/>
<View style={[{ marginLeft: marginLeft || 29 }, styles.bodyWrapper]}>

View File

@ -33,8 +33,14 @@ class PostHeaderDescription extends PureComponent {
// Component Functions
_handleOnUserPress = (username) => {
const { navigation, profileOnPress, reputation } = this.props;
const {
navigation,
profileOnPress,
reputation,
currentAccountUsername,
} = this.props;
if (currentAccountUsername !== username) {
if (profileOnPress) {
profileOnPress(username);
} else {
@ -47,6 +53,7 @@ class PostHeaderDescription extends PureComponent {
key: username,
});
}
}
};
render() {

View File

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

View File

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

View File

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