Skip to content

Commit

Permalink
fix format phone number
Browse files Browse the repository at this point in the history
  • Loading branch information
namhihi237 committed Oct 23, 2023
1 parent e73cd31 commit 1d3d7ad
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import TextLink from '../../TextLink';
import ONYXKEYS from '../../../ONYXKEYS';
import useLocalize from '../../../hooks/useLocalize';
import CONST from '../../../CONST';
import * as LocalePhoneNumber from '../../../libs/LocalePhoneNumber';

const propTypes = {
...htmlRendererPropTypes,
Expand All @@ -40,7 +41,7 @@ function MentionUserRenderer(props) {
if (!_.isEmpty(htmlAttribAccountID)) {
const user = lodashGet(props.personalDetails, htmlAttribAccountID);
accountID = parseInt(htmlAttribAccountID, 10);
displayNameOrLogin = lodashGet(user, 'login', '') || lodashGet(user, 'displayName', '') || translate('common.hidden');
displayNameOrLogin = LocalePhoneNumber.formatPhoneNumber(lodashGet(user, 'login', '')) || lodashGet(user, 'displayName', '') || translate('common.hidden');
navigationRoute = ROUTES.PROFILE.getRoute(htmlAttribAccountID);
} else if (!_.isEmpty(props.tnode.data)) {
// We need to remove the LTR unicode and leading @ from data as it is not part of the login
Expand Down
2 changes: 1 addition & 1 deletion src/pages/workspace/WorkspaceMembersPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ function WorkspaceMembersPage(props) {
icons: [
{
source: UserUtils.getAvatar(details.avatar, accountID),
name: details.login,
name: props.formatPhoneNumber(details.login),
type: CONST.ICON_TYPE_AVATAR,
},
],
Expand Down

0 comments on commit 1d3d7ad

Please sign in to comment.