Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add message user button #7135

Merged
merged 8 commits into from
Jan 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/languages/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ export default {
transferBalance: 'Transfer Balance',
cantFindAddress: 'Can\'t find your address? ',
enterManually: 'Enter it manually',
message: 'Message ',
leaveRoom: 'Leave room',
},
attachmentPicker: {
Expand Down
1 change: 1 addition & 0 deletions src/languages/es.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ export default {
transferBalance: 'Transferencia de saldo',
cantFindAddress: '¿No encuentras tu dirección? ',
enterManually: 'Ingresar manualmente',
message: 'Chatear con ',
leaveRoom: 'Salir de la sala de chat',
},
attachmentPicker: {
Expand Down
13 changes: 13 additions & 0 deletions src/pages/DetailsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ import Tooltip from '../components/Tooltip';
import CONST from '../CONST';
import * as ReportUtils from '../libs/reportUtils';
import DateUtils from '../libs/DateUtils';
import * as Expensicons from '../components/Icon/Expensicons';
import MenuItem from '../components/MenuItem';
import * as Report from '../libs/actions/Report';

const matchType = PropTypes.shape({
params: PropTypes.shape({
Expand Down Expand Up @@ -149,6 +152,13 @@ const DetailsPage = (props) => {
</View>
) : null}
</View>
<MenuItem
title={`${props.translate('common.message')}${details.displayName}`}
icon={Expensicons.ChatBubble}
onPress={() => Report.fetchOrCreateChatReport([props.session.email, details.login])}
wrapperStyle={styles.breakAll}
shouldShowRightIcon
/>
Comment on lines +155 to +161
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR caused a regression #18859. We should show the message button only if you are viewing another profile that is not yours. This was partially fixed by #7228 but it did only check against the current session email and didn't cover the secondary logins.

</ScrollView>
) : null}
</View>
Expand All @@ -162,6 +172,9 @@ DetailsPage.displayName = 'DetailsPage';
export default compose(
withLocalize,
withOnyx({
session: {
key: ONYXKEYS.SESSION,
},
personalDetails: {
key: ONYXKEYS.PERSONAL_DETAILS,
},
Expand Down