mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-30 17:14:22 +03:00
Removed open thread menu item from post comments
This commit is contained in:
parent
6a031b2a57
commit
cdbb7d833c
@ -196,7 +196,7 @@ class CommentsContainer extends Component {
|
||||
};
|
||||
|
||||
_handleOnPressCommentMenu = (index, selectedComment) => {
|
||||
const { dispatch, intl, navigation } = this.props;
|
||||
const { dispatch, intl, navigation, isOwnProfile } = this.props;
|
||||
|
||||
switch (index) {
|
||||
case 0:
|
||||
@ -211,6 +211,7 @@ class CommentsContainer extends Component {
|
||||
});
|
||||
break;
|
||||
case 1:
|
||||
case isOwnProfile:
|
||||
navigation.navigate({
|
||||
routeName: ROUTES.SCREENS.POST,
|
||||
key: get(selectedComment, 'permlink'),
|
||||
@ -241,6 +242,7 @@ class CommentsContainer extends Component {
|
||||
selectedFilter,
|
||||
mainAuthor,
|
||||
selectedPermlink: _selectedPermlink,
|
||||
isOwnProfile,
|
||||
} = this.props;
|
||||
|
||||
return (
|
||||
@ -261,6 +263,7 @@ class CommentsContainer extends Component {
|
||||
fetchPost={fetchPost}
|
||||
handleDeleteComment={this._handleDeleteComment}
|
||||
handleOnPressCommentMenu={this._handleOnPressCommentMenu}
|
||||
isOwnProfile={isOwnProfile}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
@ -55,9 +55,18 @@ class CommentsView extends Component {
|
||||
handleOnPressCommentMenu,
|
||||
handleOnVotersPress,
|
||||
intl,
|
||||
isOwnProfile,
|
||||
} = this.props;
|
||||
const { selectedComment } = this.state;
|
||||
|
||||
const menuItems = isOwnProfile
|
||||
? [
|
||||
intl.formatMessage({ id: 'post.copy_link' }),
|
||||
intl.formatMessage({ id: 'post.open_thread' }),
|
||||
intl.formatMessage({ id: 'alert.cancel' }),
|
||||
]
|
||||
: [intl.formatMessage({ id: 'post.copy_link' }), intl.formatMessage({ id: 'alert.cancel' })];
|
||||
|
||||
return (
|
||||
<Fragment>
|
||||
<FlatList
|
||||
@ -90,19 +99,9 @@ class CommentsView extends Component {
|
||||
/>
|
||||
<ActionSheet
|
||||
ref={this.commentMenu}
|
||||
options={[
|
||||
intl.formatMessage({
|
||||
id: 'post.copy_link',
|
||||
}),
|
||||
intl.formatMessage({
|
||||
id: 'post.open_thread',
|
||||
}),
|
||||
intl.formatMessage({
|
||||
id: 'alert.cancel',
|
||||
}),
|
||||
]}
|
||||
options={menuItems}
|
||||
title={get(selectedComment, 'summary')}
|
||||
cancelButtonIndex={2}
|
||||
cancelButtonIndex={isOwnProfile ? 2 : 1}
|
||||
onPress={index => handleOnPressCommentMenu(index, selectedComment)}
|
||||
/>
|
||||
</Fragment>
|
||||
|
Loading…
Reference in New Issue
Block a user