From 1d3d7ad58d75a3c3ec67a5801b839111ed6043ce Mon Sep 17 00:00:00 2001 From: Nam Le Date: Mon, 23 Oct 2023 18:45:39 +0700 Subject: [PATCH] fix format phone number --- .../HTMLEngineProvider/HTMLRenderers/MentionUserRenderer.js | 3 ++- src/pages/workspace/WorkspaceMembersPage.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/HTMLEngineProvider/HTMLRenderers/MentionUserRenderer.js b/src/components/HTMLEngineProvider/HTMLRenderers/MentionUserRenderer.js index 812f4e951f74..25f52cc31851 100644 --- a/src/components/HTMLEngineProvider/HTMLRenderers/MentionUserRenderer.js +++ b/src/components/HTMLEngineProvider/HTMLRenderers/MentionUserRenderer.js @@ -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, @@ -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 diff --git a/src/pages/workspace/WorkspaceMembersPage.js b/src/pages/workspace/WorkspaceMembersPage.js index 859064444b2c..1e6b46c806fb 100644 --- a/src/pages/workspace/WorkspaceMembersPage.js +++ b/src/pages/workspace/WorkspaceMembersPage.js @@ -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, }, ],