diff --git a/app/screens/channel_info/__snapshots__/channel_info.test.js.snap b/app/screens/channel_info/__snapshots__/channel_info.test.js.snap
index dfb411f45..0bab421c9 100644
--- a/app/screens/channel_info/__snapshots__/channel_info.test.js.snap
+++ b/app/screens/channel_info/__snapshots__/channel_info.test.js.snap
@@ -571,3 +571,815 @@ exports[`channelInfo should match snapshot 1`] = `
`;
+
+exports[`channelInfo should not include NotificationPreference for direct message 1`] = `
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+`;
+
+exports[`channelInfo should not include NotificationPreference for direct message 2`] = `
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+`;
diff --git a/app/screens/channel_info/channel_info.js b/app/screens/channel_info/channel_info.js
index 0a8759694..502aee3da 100644
--- a/app/screens/channel_info/channel_info.js
+++ b/app/screens/channel_info/channel_info.js
@@ -45,6 +45,7 @@ export default class ChannelInfo extends PureComponent {
isBot: PropTypes.bool.isRequired,
isLandscape: PropTypes.bool.isRequired,
isTeammateGuest: PropTypes.bool.isRequired,
+ isDirectMessage: PropTypes.bool.isRequired,
status: PropTypes.string,
theme: PropTypes.object.isRequired,
};
@@ -109,8 +110,8 @@ export default class ChannelInfo extends PureComponent {
showModalOverCurrentContext(screen, passProps, options);
};
- actionsRows = (style, channelIsArchived) => {
- const {currentChannel, currentUserId, isLandscape, theme} = this.props;
+ actionsRows = (channelIsArchived) => {
+ const {currentChannel, currentUserId, isLandscape, isDirectMessage, theme} = this.props;
if (channelIsArchived) {
return (
@@ -142,10 +143,12 @@ export default class ChannelInfo extends PureComponent {
theme={theme}
/>
+ {!isDirectMessage &&
+ }
}
- {this.actionsRows(style, channelIsArchived)}
+ {this.actionsRows(channelIsArchived)}
{
const original = jest.requireActual('../../utils/theme');
@@ -47,6 +48,7 @@ describe('channelInfo', () => {
theme: Preferences.THEMES.default,
isBot: false,
isTeammateGuest: false,
+ isDirectMessage: false,
isLandscape: false,
actions: {
getChannelStats: jest.fn(),
@@ -81,4 +83,20 @@ describe('channelInfo', () => {
instance.close();
expect(dismissModal).toHaveBeenCalled();
});
+
+ test('should not include NotificationPreference for direct message', () => {
+ const wrapper = shallow(
+ ,
+ {context: {intl: intlMock}},
+ );
+
+ expect(wrapper.instance().actionsRows()).toMatchSnapshot();
+ expect(wrapper.find(NotificationPreference).exists()).toEqual(true);
+
+ wrapper.setProps({isDirectMessage: true});
+ expect(wrapper.instance().actionsRows()).toMatchSnapshot();
+ expect(wrapper.find(NotificationPreference).exists()).toEqual(false);
+ });
});
diff --git a/app/screens/channel_info/index.js b/app/screens/channel_info/index.js
index 3defab5bf..f3a69b91d 100644
--- a/app/screens/channel_info/index.js
+++ b/app/screens/channel_info/index.js
@@ -32,7 +32,8 @@ function mapStateToProps(state) {
let status;
let isBot = false;
let isTeammateGuest = false;
- if (currentChannel.type === General.DM_CHANNEL) {
+ const isDirectMessage = currentChannel.type === General.DM_CHANNEL;
+ if (isDirectMessage) {
const teammateId = getUserIdFromChannelName(currentUserId, currentChannel.name);
const teammate = getUser(state, teammateId);
status = getStatusForUserId(state, teammateId);
@@ -54,6 +55,7 @@ function mapStateToProps(state) {
isBot,
isLandscape: isLandscape(state),
isTeammateGuest,
+ isDirectMessage,
status,
theme: getTheme(state),
};