[MM-10817] Add option to send message via user profile even coming from DM channel (#1796)
* add option to send message via user profile even coming from DM * add ability to DM self via user profile screen
This commit is contained in:
parent
3bde858a64
commit
4f4a261480
2 changed files with 0 additions and 15 deletions
|
|
@ -7,9 +7,7 @@ import {connect} from 'react-redux';
|
|||
import {setChannelDisplayName} from 'app/actions/views/channel';
|
||||
import {makeDirectChannel} from 'app/actions/views/more_dms';
|
||||
|
||||
import {getCurrentChannel} from 'mattermost-redux/selectors/entities/channels';
|
||||
import {getTeammateNameDisplaySetting, getTheme} from 'mattermost-redux/selectors/entities/preferences';
|
||||
import {getCurrentUserId} from 'mattermost-redux/selectors/entities/users';
|
||||
import {getConfig} from 'mattermost-redux/selectors/entities/general';
|
||||
|
||||
import UserProfile from './user_profile';
|
||||
|
|
@ -21,9 +19,7 @@ function mapStateToProps(state, ownProps) {
|
|||
return {
|
||||
config,
|
||||
createChannelRequest,
|
||||
currentChannel: getCurrentChannel(state) || {},
|
||||
currentDisplayName: state.views.channel.displayName,
|
||||
currentUserId: getCurrentUserId(state),
|
||||
user: state.entities.users.profiles[ownProps.userId],
|
||||
teammateNameDisplay: getTeammateNameDisplaySetting(state),
|
||||
theme: getTheme(state),
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@ import {
|
|||
} from 'react-native';
|
||||
import {intlShape} from 'react-intl';
|
||||
|
||||
import {getDirectChannelName} from 'mattermost-redux/utils/channel_utils';
|
||||
import {displayUsername} from 'mattermost-redux/utils/user_utils';
|
||||
|
||||
import ProfilePicture from 'app/components/profile_picture';
|
||||
|
|
@ -29,9 +28,7 @@ export default class UserProfile extends PureComponent {
|
|||
setChannelDisplayName: PropTypes.func.isRequired,
|
||||
}).isRequired,
|
||||
config: PropTypes.object.isRequired,
|
||||
currentChannel: PropTypes.object.isRequired,
|
||||
currentDisplayName: PropTypes.string,
|
||||
currentUserId: PropTypes.string.isRequired,
|
||||
navigator: PropTypes.object,
|
||||
teammateNameDisplay: PropTypes.string,
|
||||
theme: PropTypes.object.isRequired,
|
||||
|
|
@ -65,12 +62,6 @@ export default class UserProfile extends PureComponent {
|
|||
});
|
||||
};
|
||||
|
||||
displaySendMessageOption = () => {
|
||||
const {currentChannel, currentUserId, user} = this.props;
|
||||
|
||||
return currentChannel.name !== getDirectChannelName(currentUserId, user.id);
|
||||
};
|
||||
|
||||
getDisplayName = () => {
|
||||
const {theme, teammateNameDisplay, user} = this.props;
|
||||
const style = createStyleSheet(theme);
|
||||
|
|
@ -199,7 +190,6 @@ export default class UserProfile extends PureComponent {
|
|||
{config.ShowEmailAddress === 'true' && this.buildDisplayBlock('email')}
|
||||
{this.buildDisplayBlock('position')}
|
||||
</View>
|
||||
{this.displaySendMessageOption() &&
|
||||
<UserProfileRow
|
||||
action={this.sendMessage}
|
||||
defaultMessage='Send Message'
|
||||
|
|
@ -208,7 +198,6 @@ export default class UserProfile extends PureComponent {
|
|||
textId='mobile.routes.user_profile.send_message'
|
||||
theme={theme}
|
||||
/>
|
||||
}
|
||||
{this.renderAdditionalOptions()}
|
||||
</ScrollView>
|
||||
</View>
|
||||
|
|
|
|||
Loading…
Reference in a new issue