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