diff --git a/__tests__/__snapshots__/Storyshots.test.js.snap b/__tests__/__snapshots__/Storyshots.test.js.snap index 52fa5d01d..3e3106d94 100644 --- a/__tests__/__snapshots__/Storyshots.test.js.snap +++ b/__tests__/__snapshots__/Storyshots.test.js.snap @@ -59100,6 +59100,404 @@ exports[`Storyshots Room Item Tag 1`] = ` `; +exports[`Storyshots Room Item Touch 1`] = ` + + + + + + + + +  + + + Read + + + + + + + +  + + + Favorite + + + + +  + + + Hide + + + + + + + + + + + + + +  + + + rocket.cat + + + + + + + + + +`; + exports[`Storyshots Room Item Type 1`] = ` { const handlePress = () => { - if (!link) { + if (!link || !onLinkPress) { return; } onLinkPress(link); diff --git a/app/presentation/RoomItem/index.js b/app/presentation/RoomItem/index.js index d56194f8b..0b64437c6 100644 --- a/app/presentation/RoomItem/index.js +++ b/app/presentation/RoomItem/index.js @@ -117,7 +117,9 @@ class RoomItemContainer extends React.Component { onLongPress = () => { const { item, onLongPress } = this.props; - return onLongPress(item); + if (onLongPress) { + return onLongPress(item); + } } render() { diff --git a/app/utils/messageTypes.js b/app/utils/messageTypes.js index f874a437a..eacd2c514 100644 --- a/app/utils/messageTypes.js +++ b/app/utils/messageTypes.js @@ -27,10 +27,10 @@ export const MessageTypeValues = [ value: 'rm', text: 'Message_HideType_rm' }, { - value: 'subscription_role_added', + value: 'subscription-role-added', text: 'Message_HideType_subscription_role_added' }, { - value: 'subscription_role_removed', + value: 'subscription-role-removed', text: 'Message_HideType_subscription_role_removed' }, { value: 'room_archived', diff --git a/app/views/RoomActionsView/index.js b/app/views/RoomActionsView/index.js index e5c630ebb..d16ea5768 100644 --- a/app/views/RoomActionsView/index.js +++ b/app/views/RoomActionsView/index.js @@ -714,7 +714,7 @@ class RoomActionsView extends React.Component { return null; } - if (t === 'd') { + if (t === 'd' && !RocketChat.isGroupChat(room)) { return ( @@ -751,6 +751,8 @@ class RoomActionsView extends React.Component { ); } + + return null; } teamChannelActions = (t, room) => { diff --git a/storybook/stories/RoomItem.js b/storybook/stories/RoomItem.js index 025fbf7f5..c13eaa4d2 100644 --- a/storybook/stories/RoomItem.js +++ b/storybook/stories/RoomItem.js @@ -44,6 +44,9 @@ stories.add('Basic', () => ( )); +stories.add('Touch', () => ( + alert('on press')} onLongPress={() => alert('on long press')} /> +)); stories.add('User', () => ( <>