diff --git a/src/libs/PersonalDetailsUtils.ts b/src/libs/PersonalDetailsUtils.ts index e867055bbb58..af4048d5fffd 100644 --- a/src/libs/PersonalDetailsUtils.ts +++ b/src/libs/PersonalDetailsUtils.ts @@ -7,10 +7,10 @@ import type {OnyxInputOrEntry, PersonalDetails, PersonalDetailsList, PrivatePers import type {Address} from '@src/types/onyx/PrivatePersonalDetails'; import type {OnyxData} from '@src/types/onyx/Request'; import {isEmptyObject} from '@src/types/utils/EmptyObject'; -import * as LocalePhoneNumber from './LocalePhoneNumber'; -import * as Localize from './Localize'; +import {formatPhoneNumber} from './LocalePhoneNumber'; +import {translateLocal} from './Localize'; import {areEmailsFromSamePrivateDomain} from './LoginUtils'; -import * as UserUtils from './UserUtils'; +import {generateAccountID} from './UserUtils'; type FirstAndLastName = { firstName: string; @@ -43,8 +43,8 @@ Onyx.connect({ if (!value) { return; } - hiddenTranslation = Localize.translateLocal('common.hidden'); - youTranslation = Localize.translateLocal('common.you').toLowerCase(); + hiddenTranslation = translateLocal('common.hidden'); + youTranslation = translateLocal('common.you').toLowerCase(); }, }); @@ -119,7 +119,7 @@ function getPersonalDetailsByIDs({ if (shouldChangeUserDisplayName && currentUserAccountID === detail.accountID) { return { ...detail, - displayName: Localize.translateLocal('common.you'), + displayName: translateLocal('common.you'), }; } @@ -144,7 +144,7 @@ function getAccountIDsByLogins(logins: string[]): number[] { const currentDetail = personalDetails.find((detail) => detail?.login === login?.toLowerCase()); if (!currentDetail) { // generate an account ID because in this case the detail is probably new, so we don't have a real accountID yet - foundAccountIDs.push(UserUtils.generateAccountID(login)); + foundAccountIDs.push(generateAccountID(login)); } else { foundAccountIDs.push(Number(currentDetail.accountID)); } @@ -198,7 +198,7 @@ function getPersonalDetailsOnyxDataForOptimisticUsers(newLogins: string[], newAc personalDetailsNew[accountID] = { login, accountID, - displayName: LocalePhoneNumber.formatPhoneNumber(login), + displayName: formatPhoneNumber(login), isOptimisticPersonalDetail: true, }; @@ -295,7 +295,7 @@ function getFormattedAddress(privatePersonalDetails: OnyxEntry | OnyxInputOrEntry): string { // If we have a number like +15857527441@expensify.sms then let's remove @expensify.sms and format it // so that the option looks cleaner in our UI. - const userLogin = LocalePhoneNumber.formatPhoneNumber(login); + const userLogin = formatPhoneNumber(login); if (!passedPersonalDetails) { return userLogin;