From d26e89373ad8fb67c5e687ab80174dcbea8f8bb5 Mon Sep 17 00:00:00 2001 From: Jakub Kosmydel <104823336+kosmydel@users.noreply.github.com> Date: Mon, 20 May 2024 10:50:12 +0200 Subject: [PATCH 1/4] cleanup: remove DetailsPage --- src/ROUTES.ts | 10 +- .../HTMLRenderers/MentionUserRenderer.tsx | 2 +- .../ModalStackNavigators/index.tsx | 6 - .../Navigators/RightModalNavigator.tsx | 4 - src/libs/Navigation/linkingConfig/config.ts | 5 - src/libs/Navigation/types.ts | 1 + src/pages/DetailsPage.tsx | 189 ------------------ src/pages/ProfilePage.tsx | 23 ++- 8 files changed, 27 insertions(+), 213 deletions(-) delete mode 100755 src/pages/DetailsPage.tsx diff --git a/src/ROUTES.ts b/src/ROUTES.ts index 0dff2992fe91..0bf1d499ba5d 100644 --- a/src/ROUTES.ts +++ b/src/ROUTES.ts @@ -40,13 +40,13 @@ const ROUTES = { getRoute: (reportID: string, reportActionID: string) => `flag/${reportID}/${reportActionID}` as const, }, CHAT_FINDER: 'chat-finder', - DETAILS: { - route: 'details', - getRoute: (login: string) => `details?login=${encodeURIComponent(login)}` as const, - }, PROFILE: { route: 'a/:accountID', - getRoute: (accountID: string | number, backTo?: string) => getUrlWithBackToParam(`a/${accountID}`, backTo), + getRoute: (accountID?: string | number, login?: string, backTo?: string) => { + const baseRoute = getUrlWithBackToParam(`a/${accountID}`, backTo); + const loginParam = login ? `?login=${encodeURIComponent(login)}` : ''; + return `${baseRoute}${loginParam}` as const; + }, }, PROFILE_AVATAR: { route: 'a/:accountID/avatar', diff --git a/src/components/HTMLEngineProvider/HTMLRenderers/MentionUserRenderer.tsx b/src/components/HTMLEngineProvider/HTMLRenderers/MentionUserRenderer.tsx index 504ddecb492b..abb9d91f37e9 100644 --- a/src/components/HTMLEngineProvider/HTMLRenderers/MentionUserRenderer.tsx +++ b/src/components/HTMLEngineProvider/HTMLRenderers/MentionUserRenderer.tsx @@ -69,7 +69,7 @@ function MentionUserRenderer({style, tnode, TDefaultRenderer, currentUserPersona asMutable(tnodeClone).data = tnodeClone.data.replace(mentionDisplayText, Str.removeSMSDomain(getShortMentionIfFound(mentionDisplayText, htmlAttributeAccountID))); accountID = PersonalDetailsUtils.getAccountIDsByLogins([mentionDisplayText])?.[0]; - navigationRoute = ROUTES.DETAILS.getRoute(mentionDisplayText); + navigationRoute = ROUTES.PROFILE.getRoute(undefined, mentionDisplayText); mentionDisplayText = Str.removeSMSDomain(mentionDisplayText); } else { // If neither an account ID or email is provided, don't render anything diff --git a/src/libs/Navigation/AppNavigator/ModalStackNavigators/index.tsx b/src/libs/Navigation/AppNavigator/ModalStackNavigators/index.tsx index 47d170ce5cd5..c53ac0569ea9 100644 --- a/src/libs/Navigation/AppNavigator/ModalStackNavigators/index.tsx +++ b/src/libs/Navigation/AppNavigator/ModalStackNavigators/index.tsx @@ -4,7 +4,6 @@ import {createStackNavigator} from '@react-navigation/stack'; import React from 'react'; import type { AddPersonalBankAccountNavigatorParamList, - DetailsNavigatorParamList, EditRequestNavigatorParamList, EnablePaymentsNavigatorParamList, FlagCommentNavigatorParamList, @@ -103,10 +102,6 @@ const SplitDetailsModalStackNavigator = createModalStackNavigator require('../../../../pages/iou/SplitBillDetailsPage').default as React.ComponentType, }); -const DetailsModalStackNavigator = createModalStackNavigator({ - [SCREENS.DETAILS_ROOT]: () => require('../../../../pages/DetailsPage').default as React.ComponentType, -}); - const ProfileModalStackNavigator = createModalStackNavigator({ [SCREENS.PROFILE_ROOT]: () => require('../../../../pages/ProfilePage').default as React.ComponentType, }); @@ -371,7 +366,6 @@ const SearchReportModalStackNavigator = createModalStackNavigator - ['config'] = { [SCREENS.I_AM_A_TEACHER]: ROUTES.I_AM_A_TEACHER, }, }, - [SCREENS.RIGHT_MODAL.DETAILS]: { - screens: { - [SCREENS.DETAILS_ROOT]: ROUTES.DETAILS.route, - }, - }, [SCREENS.RIGHT_MODAL.PROFILE]: { screens: { [SCREENS.PROFILE_ROOT]: ROUTES.PROFILE.route, diff --git a/src/libs/Navigation/types.ts b/src/libs/Navigation/types.ts index a0cd76637716..da0195e84733 100644 --- a/src/libs/Navigation/types.ts +++ b/src/libs/Navigation/types.ts @@ -409,6 +409,7 @@ type ProfileNavigatorParamList = { [SCREENS.PROFILE_ROOT]: { accountID: string; reportID: string; + login?: string; backTo: Routes; }; }; diff --git a/src/pages/DetailsPage.tsx b/src/pages/DetailsPage.tsx deleted file mode 100755 index 49b3e856c65d..000000000000 --- a/src/pages/DetailsPage.tsx +++ /dev/null @@ -1,189 +0,0 @@ -import type {StackScreenProps} from '@react-navigation/stack'; -import Str from 'expensify-common/lib/str'; -import React from 'react'; -import {View} from 'react-native'; -import {withOnyx} from 'react-native-onyx'; -import type {OnyxEntry} from 'react-native-onyx'; -import AttachmentModal from '@components/AttachmentModal'; -import AutoUpdateTime from '@components/AutoUpdateTime'; -import Avatar from '@components/Avatar'; -import FullPageNotFoundView from '@components/BlockingViews/FullPageNotFoundView'; -import CommunicationsLink from '@components/CommunicationsLink'; -import HeaderWithBackButton from '@components/HeaderWithBackButton'; -import * as Expensicons from '@components/Icon/Expensicons'; -import MenuItem from '@components/MenuItem'; -import OfflineWithFeedback from '@components/OfflineWithFeedback'; -import PressableWithoutFocus from '@components/Pressable/PressableWithoutFocus'; -import ScreenWrapper from '@components/ScreenWrapper'; -import ScrollView from '@components/ScrollView'; -import Text from '@components/Text'; -import UserDetailsTooltip from '@components/UserDetailsTooltip'; -import useLocalize from '@hooks/useLocalize'; -import useThemeStyles from '@hooks/useThemeStyles'; -import * as PersonalDetailsUtils from '@libs/PersonalDetailsUtils'; -import {parsePhoneNumber} from '@libs/PhoneNumber'; -import * as ReportUtils from '@libs/ReportUtils'; -import * as UserUtils from '@libs/UserUtils'; -import type {DetailsNavigatorParamList} from '@navigation/types'; -import * as Report from '@userActions/Report'; -import CONST from '@src/CONST'; -import type {TranslationPaths} from '@src/languages/types'; -import ONYXKEYS from '@src/ONYXKEYS'; -import type SCREENS from '@src/SCREENS'; -import type {PersonalDetails, PersonalDetailsList, Session} from '@src/types/onyx'; - -type DetailsPageOnyxProps = { - /** The personal details of the person who is logged in */ - personalDetails: OnyxEntry; - - /** Session info for the currently logged in user. */ - session: OnyxEntry; -}; - -type DetailsPageProps = DetailsPageOnyxProps & StackScreenProps; - -/** - * Gets the phone number to display for SMS logins - */ -const getPhoneNumber = ({login = '', displayName = ''}: PersonalDetails): string | undefined => { - // If the user hasn't set a displayName, it is set to their phone number, so use that - const parsedPhoneNumber = parsePhoneNumber(displayName); - if (parsedPhoneNumber.possible) { - return parsedPhoneNumber?.number?.e164; - } - - // If the user has set a displayName, get the phone number from the SMS login - return login ? Str.removeSMSDomain(login) : ''; -}; - -function DetailsPage({personalDetails, route, session}: DetailsPageProps) { - const styles = useThemeStyles(); - const {translate, formatPhoneNumber} = useLocalize(); - const login = route.params?.login ?? ''; - const sessionAccountID = session?.accountID ?? 0; - - let details = Object.values(personalDetails ?? {}).find((personalDetail) => personalDetail?.login === login.toLowerCase()); - - if (!details) { - const optimisticAccountID = UserUtils.generateAccountID(login); - details = { - accountID: optimisticAccountID, - login, - displayName: login, - avatar: UserUtils.getDefaultAvatar(optimisticAccountID), - }; - } - - const isSMSLogin = details.login ? Str.isSMSLogin(details.login) : false; - - const shouldShowLocalTime = !ReportUtils.hasAutomatedExpensifyAccountIDs([details.accountID]) && details.timezone; - let pronouns = details.pronouns; - - if (pronouns && pronouns.startsWith(CONST.PRONOUNS.PREFIX)) { - const localeKey = pronouns.replace(CONST.PRONOUNS.PREFIX, ''); - pronouns = translate(`pronouns.${localeKey}` as TranslationPaths); - } - - const phoneNumber = getPhoneNumber(details); - const phoneOrEmail = isSMSLogin ? getPhoneNumber(details) : details.login; - const displayName = PersonalDetailsUtils.getDisplayNameOrDefault(details, '', false); - - const isCurrentUser = sessionAccountID === details.accountID; - - return ( - - - - - {details ? ( - - - - {({show}) => ( - - - - - - )} - - {Boolean(displayName) && ( - - {displayName} - - )} - {details.login ? ( - - - {translate(isSMSLogin ? 'common.phoneNumber' : 'common.email')} - - - - {isSMSLogin ? formatPhoneNumber(phoneNumber ?? '') : details.login} - - - - ) : null} - {pronouns ? ( - - - {translate('profilePage.preferredPronouns')} - - {pronouns} - - ) : null} - {shouldShowLocalTime && } - - {!isCurrentUser && ( - Report.navigateToAndOpenReport([login])} - wrapperStyle={styles.breakAll} - shouldShowRightIcon - /> - )} - - ) : null} - - - - ); -} - -DetailsPage.displayName = 'DetailsPage'; - -export default withOnyx({ - personalDetails: { - key: ONYXKEYS.PERSONAL_DETAILS_LIST, - }, - session: { - key: ONYXKEYS.SESSION, - }, -})(DetailsPage); diff --git a/src/pages/ProfilePage.tsx b/src/pages/ProfilePage.tsx index 0d569cb6e30b..2b2eae4e6a26 100755 --- a/src/pages/ProfilePage.tsx +++ b/src/pages/ProfilePage.tsx @@ -95,7 +95,24 @@ function ProfilePage({route}: ProfilePageProps) { const {translate, formatPhoneNumber} = useLocalize(); const accountID = Number(route.params?.accountID ?? 0); const isCurrentUser = session?.accountID === accountID; - const details: PersonalDetails | EmptyObject = personalDetails?.[accountID] ?? (ValidationUtils.isValidAccountRoute(accountID) ? {} : {accountID: 0, avatar: ''}); + + const details = useMemo((): PersonalDetails | EmptyObject => { + if (personalDetails?.[accountID]) { + return personalDetails?.[accountID] ?? {}; + } + if (ValidationUtils.isValidAccountRoute(accountID)) { + return {}; + } + if (!route.params.login) { + return {accountID: 0, avatar: ''}; + } + const foundDetails = Object.values(personalDetails ?? {}).find((personalDetail) => personalDetail?.login === route.params.login?.toLowerCase()); + if (foundDetails) { + return foundDetails; + } + const optimisticAccountID = UserUtils.generateAccountID(route.params.login); + return {accountID: optimisticAccountID, login: route.params.login, displayName: route.params.login, avatar: UserUtils.getDefaultAvatar(optimisticAccountID)}; + }, [accountID, personalDetails, route.params.login]); const displayName = PersonalDetailsUtils.getDisplayNameOrDefault(details, undefined, undefined, isCurrentUser); // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing @@ -123,7 +140,7 @@ function ProfilePage({route}: ProfilePageProps) { const isLoading = Boolean(personalDetailsMetadata?.[accountID]?.isLoading) || isEmptyObject(details); // If the API returns an error for some reason there won't be any details and isLoading will get set to false, so we want to show a blocking screen - const shouldShowBlockingView = !hasMinimumDetails && !isLoading; + const shouldShowBlockingView = !hasMinimumDetails && !isLoading && !login; const statusEmojiCode = details?.status?.emojiCode ?? ''; const statusText = details?.status?.text ?? ''; @@ -165,7 +182,7 @@ function ProfilePage({route}: ProfilePageProps) { onBackButtonPress={() => Navigation.goBack(navigateBackTo)} /> - {hasMinimumDetails && ( + {true && ( Date: Mon, 20 May 2024 12:22:05 +0200 Subject: [PATCH 2/4] fix: navigtion to threads --- src/components/PromotedActionsBar.tsx | 14 +++++++++++--- src/pages/ProfilePage.tsx | 17 +++++++++-------- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/src/components/PromotedActionsBar.tsx b/src/components/PromotedActionsBar.tsx index aa9ceaef0958..e6f070560cc8 100644 --- a/src/components/PromotedActionsBar.tsx +++ b/src/components/PromotedActionsBar.tsx @@ -21,7 +21,7 @@ type ReportPromotedAction = (report: OnyxReport) => PromotedAction; type PromotedActionsType = { pin: ReportPromotedAction; - message: (accountID: number) => PromotedAction; + message: (params: {accountID?: number; login?: string}) => PromotedAction; // join: ReportPromotedAction; // share: ReportPromotedAction; // hold: () => PromotedAction; @@ -32,11 +32,19 @@ const PromotedActions = { key: 'pin', ...HeaderUtils.getPinMenuItem(report), }), - message: (accountID) => ({ + message: ({accountID, login}) => ({ key: 'message', icon: Expensicons.CommentBubbles, text: Localize.translateLocal('common.message'), - onSelected: () => ReportActions.navigateToAndOpenReportWithAccountIDs([accountID]), + onSelected: () => { + if (accountID) { + ReportActions.navigateToAndOpenReportWithAccountIDs([accountID]); + return; + } + if (login) { + ReportActions.navigateToAndOpenReport([login]); + } + }, }), // join: (report) => ({ // key: 'join', diff --git a/src/pages/ProfilePage.tsx b/src/pages/ProfilePage.tsx index 2b2eae4e6a26..37075d8d8da9 100755 --- a/src/pages/ProfilePage.tsx +++ b/src/pages/ProfilePage.tsx @@ -95,6 +95,7 @@ function ProfilePage({route}: ProfilePageProps) { const {translate, formatPhoneNumber} = useLocalize(); const accountID = Number(route.params?.accountID ?? 0); const isCurrentUser = session?.accountID === accountID; + const loginParams = route.params?.login; const details = useMemo((): PersonalDetails | EmptyObject => { if (personalDetails?.[accountID]) { @@ -103,16 +104,16 @@ function ProfilePage({route}: ProfilePageProps) { if (ValidationUtils.isValidAccountRoute(accountID)) { return {}; } - if (!route.params.login) { + if (!loginParams) { return {accountID: 0, avatar: ''}; } - const foundDetails = Object.values(personalDetails ?? {}).find((personalDetail) => personalDetail?.login === route.params.login?.toLowerCase()); + const foundDetails = Object.values(personalDetails ?? {}).find((personalDetail) => personalDetail?.login === loginParams?.toLowerCase()); if (foundDetails) { return foundDetails; } - const optimisticAccountID = UserUtils.generateAccountID(route.params.login); - return {accountID: optimisticAccountID, login: route.params.login, displayName: route.params.login, avatar: UserUtils.getDefaultAvatar(optimisticAccountID)}; - }, [accountID, personalDetails, route.params.login]); + const optimisticAccountID = UserUtils.generateAccountID(loginParams); + return {accountID: optimisticAccountID, login: loginParams, displayName: loginParams, avatar: UserUtils.getDefaultAvatar(optimisticAccountID)}; + }, [accountID, personalDetails, loginParams]); const displayName = PersonalDetailsUtils.getDisplayNameOrDefault(details, undefined, undefined, isCurrentUser); // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing @@ -169,10 +170,10 @@ function ProfilePage({route}: ProfilePageProps) { } if (!isCurrentUser && !SessionActions.isAnonymousUser()) { - result.push(PromotedActions.message(accountID)); + result.push(PromotedActions.message({accountID, login: loginParams})); } return result; - }, [accountID, isCurrentUser, report]); + }, [accountID, isCurrentUser, loginParams, report]); return ( @@ -182,7 +183,7 @@ function ProfilePage({route}: ProfilePageProps) { onBackButtonPress={() => Navigation.goBack(navigateBackTo)} /> - {true && ( + {hasMinimumDetails && ( Date: Tue, 21 May 2024 15:59:22 +0200 Subject: [PATCH 3/4] cleanup --- src/ROUTES.ts | 2 +- .../HTMLRenderers/MentionUserRenderer.tsx | 3 ++- src/components/PromotedActionsBar.tsx | 9 +++++---- src/pages/ProfilePage.tsx | 19 ++++++++++--------- 4 files changed, 18 insertions(+), 15 deletions(-) diff --git a/src/ROUTES.ts b/src/ROUTES.ts index 0bf1d499ba5d..ba7c7070f296 100644 --- a/src/ROUTES.ts +++ b/src/ROUTES.ts @@ -42,7 +42,7 @@ const ROUTES = { CHAT_FINDER: 'chat-finder', PROFILE: { route: 'a/:accountID', - getRoute: (accountID?: string | number, login?: string, backTo?: string) => { + getRoute: (accountID?: string | number, backTo?: string, login?: string) => { const baseRoute = getUrlWithBackToParam(`a/${accountID}`, backTo); const loginParam = login ? `?login=${encodeURIComponent(login)}` : ''; return `${baseRoute}${loginParam}` as const; diff --git a/src/components/HTMLEngineProvider/HTMLRenderers/MentionUserRenderer.tsx b/src/components/HTMLEngineProvider/HTMLRenderers/MentionUserRenderer.tsx index abb9d91f37e9..4d57c98e52dc 100644 --- a/src/components/HTMLEngineProvider/HTMLRenderers/MentionUserRenderer.tsx +++ b/src/components/HTMLEngineProvider/HTMLRenderers/MentionUserRenderer.tsx @@ -19,6 +19,7 @@ import * as LoginUtils from '@libs/LoginUtils'; import Navigation from '@libs/Navigation/Navigation'; import * as PersonalDetailsUtils from '@libs/PersonalDetailsUtils'; import * as ReportUtils from '@libs/ReportUtils'; +import * as UserUtils from '@libs/UserUtils'; import CONST from '@src/CONST'; import ROUTES from '@src/ROUTES'; import type {Route} from '@src/ROUTES'; @@ -69,7 +70,7 @@ function MentionUserRenderer({style, tnode, TDefaultRenderer, currentUserPersona asMutable(tnodeClone).data = tnodeClone.data.replace(mentionDisplayText, Str.removeSMSDomain(getShortMentionIfFound(mentionDisplayText, htmlAttributeAccountID))); accountID = PersonalDetailsUtils.getAccountIDsByLogins([mentionDisplayText])?.[0]; - navigationRoute = ROUTES.PROFILE.getRoute(undefined, mentionDisplayText); + navigationRoute = ROUTES.PROFILE.getRoute(accountID, undefined, mentionDisplayText); mentionDisplayText = Str.removeSMSDomain(mentionDisplayText); } else { // If neither an account ID or email is provided, don't render anything diff --git a/src/components/PromotedActionsBar.tsx b/src/components/PromotedActionsBar.tsx index e6f070560cc8..59fcd37b7b85 100644 --- a/src/components/PromotedActionsBar.tsx +++ b/src/components/PromotedActionsBar.tsx @@ -37,12 +37,13 @@ const PromotedActions = { icon: Expensicons.CommentBubbles, text: Localize.translateLocal('common.message'), onSelected: () => { - if (accountID) { - ReportActions.navigateToAndOpenReportWithAccountIDs([accountID]); - return; - } + // The accountID might be optimistic, so we should use the login if we have it if (login) { ReportActions.navigateToAndOpenReport([login]); + return; + } + if (accountID) { + ReportActions.navigateToAndOpenReportWithAccountIDs([accountID]); } }, }), diff --git a/src/pages/ProfilePage.tsx b/src/pages/ProfilePage.tsx index 37075d8d8da9..78eb9969578a 100755 --- a/src/pages/ProfilePage.tsx +++ b/src/pages/ProfilePage.tsx @@ -98,26 +98,27 @@ function ProfilePage({route}: ProfilePageProps) { const loginParams = route.params?.login; const details = useMemo((): PersonalDetails | EmptyObject => { + // Check if we have the personal details already in Onyx if (personalDetails?.[accountID]) { return personalDetails?.[accountID] ?? {}; } - if (ValidationUtils.isValidAccountRoute(accountID)) { - return {}; - } + // Check if we have the login param if (!loginParams) { - return {accountID: 0, avatar: ''}; + return {}; } + // Look up the personal details by login const foundDetails = Object.values(personalDetails ?? {}).find((personalDetail) => personalDetail?.login === loginParams?.toLowerCase()); if (foundDetails) { return foundDetails; } + // If we don't have the personal details in Onyx, we can create an optimistic account const optimisticAccountID = UserUtils.generateAccountID(loginParams); - return {accountID: optimisticAccountID, login: loginParams, displayName: loginParams, avatar: UserUtils.getDefaultAvatar(optimisticAccountID)}; + return {accountID: optimisticAccountID, login: loginParams, displayName: loginParams}; }, [accountID, personalDetails, loginParams]); const displayName = PersonalDetailsUtils.getDisplayNameOrDefault(details, undefined, undefined, isCurrentUser); // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing - const avatar = details?.avatar || UserUtils.getDefaultAvatar(); // we can have an empty string and in this case, we need to show the default avatar + const avatar = details?.avatar; // we can have an empty string and in this case, we need to show the default avatar const fallbackIcon = details?.fallbackIcon ?? ''; const login = details?.login ?? ''; const timezone = details?.timezone; @@ -137,7 +138,7 @@ function ProfilePage({route}: ProfilePageProps) { const phoneNumber = getPhoneNumber(details); const phoneOrEmail = isSMSLogin ? getPhoneNumber(details) : login; - const hasMinimumDetails = !isEmptyObject(details.avatar); + const hasMinimumDetails = !!avatar || !!loginParams; const isLoading = Boolean(personalDetailsMetadata?.[accountID]?.isLoading) || isEmptyObject(details); // If the API returns an error for some reason there won't be any details and isLoading will get set to false, so we want to show a blocking screen @@ -158,10 +159,10 @@ function ProfilePage({route}: ProfilePageProps) { // eslint-disable-next-line rulesdir/prefer-early-return useEffect(() => { - if (ValidationUtils.isValidAccountRoute(accountID)) { + if (ValidationUtils.isValidAccountRoute(accountID) && !loginParams) { PersonalDetailsActions.openPublicProfilePage(accountID); } - }, [accountID]); + }, [accountID, loginParams]); const promotedActions = useMemo(() => { const result: PromotedAction[] = []; From 585e3c1d91b03360fb1c8dca55e9702d4b901c9c Mon Sep 17 00:00:00 2001 From: Jakub Kosmydel <104823336+kosmydel@users.noreply.github.com> Date: Wed, 5 Jun 2024 08:22:52 +0200 Subject: [PATCH 4/4] fix: lint --- .../HTMLEngineProvider/HTMLRenderers/MentionUserRenderer.tsx | 1 - src/pages/ProfilePage.tsx | 1 - 2 files changed, 2 deletions(-) diff --git a/src/components/HTMLEngineProvider/HTMLRenderers/MentionUserRenderer.tsx b/src/components/HTMLEngineProvider/HTMLRenderers/MentionUserRenderer.tsx index 4d57c98e52dc..2f5f3baf764d 100644 --- a/src/components/HTMLEngineProvider/HTMLRenderers/MentionUserRenderer.tsx +++ b/src/components/HTMLEngineProvider/HTMLRenderers/MentionUserRenderer.tsx @@ -19,7 +19,6 @@ import * as LoginUtils from '@libs/LoginUtils'; import Navigation from '@libs/Navigation/Navigation'; import * as PersonalDetailsUtils from '@libs/PersonalDetailsUtils'; import * as ReportUtils from '@libs/ReportUtils'; -import * as UserUtils from '@libs/UserUtils'; import CONST from '@src/CONST'; import ROUTES from '@src/ROUTES'; import type {Route} from '@src/ROUTES'; diff --git a/src/pages/ProfilePage.tsx b/src/pages/ProfilePage.tsx index 911d732cd745..f1bfe8369c7d 100755 --- a/src/pages/ProfilePage.tsx +++ b/src/pages/ProfilePage.tsx @@ -120,7 +120,6 @@ function ProfilePage({route}: ProfilePageProps) { const displayName = PersonalDetailsUtils.getDisplayNameOrDefault(details, undefined, undefined, isCurrentUser); // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing - const avatar = details?.avatar; // we can have an empty string and in this case, we need to show the default avatar const fallbackIcon = details?.fallbackIcon ?? ''; const login = details?.login ?? ''; const timezone = details?.timezone;