From 97a0571f50671e263027dd9a76d3d908936cb0df Mon Sep 17 00:00:00 2001 From: Mohammad Luthfi Fathur Rahman Date: Tue, 25 Nov 2025 20:04:09 +0700 Subject: [PATCH 1/3] Revert "Merge pull request #75371 from apeyada/fix-75252" This reverts commit cad35336028fb841c0609d4d950a243a4c478242, reversing changes made to dd6622eeb76733840b40e29026085d8883a31e1f. --- src/components/AccountSwitcher.tsx | 5 +- src/components/AnimatedCollapsible/index.tsx | 5 +- src/components/ApprovalWorkflowSection.tsx | 3 +- .../AttachmentCarousel/CarouselButtons.tsx | 7 ++- .../Attachments/AttachmentView/index.tsx | 6 ++- src/components/Avatar.tsx | 14 +++--- src/components/AvatarButtonWithIcon.tsx | 7 +-- src/components/AvatarWithImagePicker.tsx | 5 +- src/components/AvatarWithIndicator.tsx | 9 ++-- src/components/BigNumberPad.tsx | 5 +- src/components/Button/index.tsx | 9 ++-- .../ButtonWithDropdownMenu/index.tsx | 7 ++- src/components/CaretWrapper.tsx | 5 +- src/components/CollapsibleSection/index.tsx | 5 +- .../DatePicker/CalendarPicker/ArrowIcon.tsx | 5 +- src/components/Domain/DomainMenuItem.tsx | 3 +- .../EmojiPicker/EmojiPickerButtonDropdown.tsx | 5 +- .../HTMLRenderers/DeletedActionRenderer.tsx | 6 +-- src/components/HeaderWithBackButton/index.tsx | 3 +- src/components/Icon/Expensicons.ts | 48 ++++++++++++++----- src/components/MenuItem.tsx | 15 +++--- src/components/NumberWithSymbolForm.tsx | 7 +-- src/components/Picker/BasePicker.tsx | 7 ++- src/components/PrevNextButtons.tsx | 7 ++- .../Reactions/AddReactionBubble.tsx | 5 +- .../Reactions/MiniQuickEmojiReactions.tsx | 5 +- .../useReportActionAvatars.ts | 10 ++-- .../MoneyRequestReportPreviewContent.tsx | 7 +-- .../ReportActionItem/TaskPreview.tsx | 8 +--- src/components/ReportActionItem/TaskView.tsx | 5 +- .../ReportActionItem/TripDetailsView.tsx | 5 +- src/components/ReportHeaderSkeletonView.tsx | 10 +--- src/components/RoomHeaderAvatars.tsx | 6 +-- .../SelectionList/ListItem/UserListItem.tsx | 5 +- .../BaseListItem.tsx | 4 +- .../ListItemRightCaretWithLabel.tsx | 5 +- .../Search/CardListItem.tsx | 5 +- .../Search/CardListItemHeader.tsx | 6 +-- .../Search/MemberListItemHeader.tsx | 5 +- .../Search/ReportListItemHeader.tsx | 5 +- .../Search/TaskListItemRow.tsx | 5 +- .../Search/UserInfoCellsWithArrow.tsx | 5 +- .../Search/WithdrawalIDListItemHeader.tsx | 6 +-- .../SortableHeaderText.tsx | 5 +- .../SplitListItem.tsx | 6 ++- .../UserListItem.tsx | 5 +- .../SidePanel/HelpComponents/HelpHeader.tsx | 5 +- src/components/SymbolButton.tsx | 6 +-- src/components/TransactionItemRow/index.tsx | 5 +- .../VideoPlayer/VideoPlayerControls/index.tsx | 10 ++-- src/components/VideoPlayerPreview/index.tsx | 5 +- .../WorkspaceMembersSelectionList.tsx | 7 ++- src/hooks/useDefaultAvatars.ts | 5 -- src/hooks/useWorkspaceConfirmationAvatar.tsx | 7 ++- src/libs/UserAvatarUtils.ts | 21 ++++---- src/pages/NewReportWorkspaceSelectionPage.tsx | 7 ++- .../BaseOnboardingWorkspaces.tsx | 7 ++- .../BeneficialOwnersList.tsx | 5 +- .../subSteps/CompanyOwnersListUBO.tsx | 11 ++--- src/pages/ReportAddApproverPage.tsx | 7 ++- src/pages/ReportParticipantsPage.tsx | 6 +-- src/pages/RoomMembersPage.tsx | 7 ++- src/pages/Share/ShareDetailsPage.tsx | 8 ++-- src/pages/ShareCodePage.tsx | 3 +- src/pages/Travel/CarTripDetails.tsx | 5 +- src/pages/Travel/FlightTripDetails.tsx | 5 +- src/pages/Travel/HotelTripDetails.tsx | 5 +- src/pages/Travel/TrainTripDetails.tsx | 5 +- src/pages/home/HeaderView.tsx | 6 +-- .../BaseReportActionContextMenu.tsx | 2 +- .../report/ContextMenu/ContextMenuActions.tsx | 4 +- .../home/report/FloatingMessageCounter.tsx | 5 +- .../report/ReactionList/BaseReactionList.tsx | 5 +- .../AttachmentPickerWithMenuItems.tsx | 5 +- .../home/sidebar/AvatarWithDelegateAvatar.tsx | 4 +- src/pages/iou/SplitExpensePage.tsx | 19 +------- .../step/IOURequestStepPerDiemWorkspace.tsx | 7 ++- .../ReceiptPreviews/index.tsx | 5 +- .../request/step/IOURequestStepSendFrom.tsx | 7 ++- .../routes/ProfileAvatarModalContent.tsx | 5 +- .../routes/WorkspaceAvatarModalContent.tsx | 5 +- .../report/ReportAvatarModalContent.tsx | 13 ++--- src/pages/settings/AboutPage/ConsolePage.tsx | 5 +- .../Profile/CustomStatus/StatusPage.tsx | 5 +- .../CustomStatus/VacationDelegatePage.tsx | 15 ++---- .../AddDelegate/ConfirmDelegatePage.tsx | 5 +- .../Security/SecuritySettingsPage.tsx | 13 ++--- .../settings/Wallet/PaymentMethodList.tsx | 8 +--- .../workspace/WorkspaceOverviewSharePage.tsx | 3 +- src/pages/workspace/WorkspacesListRow.tsx | 6 +-- .../accounting/PolicyAccountingPage.tsx | 33 +++++-------- .../WorkspaceCompanyCardDetailsPage.tsx | 8 ++-- .../WorkspaceCompanyCardsListRow.tsx | 5 +- .../companyCards/assignCard/AssigneeStep.tsx | 7 ++- .../expensifyCard/WorkspaceCardListRow.tsx | 7 ++- .../WorkspaceExpensifyCardDetailsPage.tsx | 8 ++-- .../expensifyCard/issueNew/AssigneeStep.tsx | 8 ++-- .../ChangeReceiptBillingAccountPage.tsx | 7 ++- .../EditInviteReceiptPartnerPolicyPage.tsx | 7 ++- .../InviteReceiptPartnerPolicyPage.tsx | 9 ++-- ...orkflowsConnectExistingBankAccountPage.tsx | 5 +- .../workflows/WorkspaceWorkflowsPayerPage.tsx | 17 ++----- ...orkspaceWorkflowsApprovalsApproverPage.tsx | 6 +-- ...paceWorkflowsApprovalsExpensesFromPage.tsx | 20 ++------ src/stories/OptionRow.stories.tsx | 4 +- tests/unit/UserAvatarUtilsTest.ts | 40 +++++----------- 106 files changed, 315 insertions(+), 506 deletions(-) delete mode 100644 src/hooks/useDefaultAvatars.ts diff --git a/src/components/AccountSwitcher.tsx b/src/components/AccountSwitcher.tsx index 7495ee4a5925..a22fb01ca7d5 100644 --- a/src/components/AccountSwitcher.tsx +++ b/src/components/AccountSwitcher.tsx @@ -3,7 +3,6 @@ import {Str} from 'expensify-common'; import React, {useRef, useState} from 'react'; import {View} from 'react-native'; import useCurrentUserPersonalDetails from '@hooks/useCurrentUserPersonalDetails'; -import {useMemoizedLazyExpensifyIcons} from '@hooks/useLazyAsset'; import useLocalize from '@hooks/useLocalize'; import useNetwork from '@hooks/useNetwork'; import useOnyx from '@hooks/useOnyx'; @@ -24,7 +23,6 @@ import type {Errors} from '@src/types/onyx/OnyxCommon'; import Avatar from './Avatar'; import ConfirmModal from './ConfirmModal'; import Icon from './Icon'; -// eslint-disable-next-line no-restricted-imports import * as Expensicons from './Icon/Expensicons'; import type {PopoverMenuItem} from './PopoverMenu'; import PopoverMenu from './PopoverMenu'; @@ -57,7 +55,6 @@ function AccountSwitcher({isScreenFocused}: AccountSwitcherProps) { const buttonRef = useRef(null); const {windowHeight} = useWindowDimensions(); - const expensifyIcons = useMemoizedLazyExpensifyIcons(['CaretUpDown'] as const); const [shouldShowDelegatorMenu, setShouldShowDelegatorMenu] = useState(false); const [shouldShowOfflineModal, setShouldShowOfflineModal] = useState(false); @@ -222,7 +219,7 @@ function AccountSwitcher({isScreenFocused}: AccountSwitcherProps) { diff --git a/src/components/AnimatedCollapsible/index.tsx b/src/components/AnimatedCollapsible/index.tsx index 5ccad9e54a31..83290d66ac5e 100644 --- a/src/components/AnimatedCollapsible/index.tsx +++ b/src/components/AnimatedCollapsible/index.tsx @@ -5,9 +5,9 @@ import type {StyleProp, ViewStyle} from 'react-native'; import Animated, {useAnimatedStyle, useDerivedValue, useSharedValue, withTiming} from 'react-native-reanimated'; import {scheduleOnRN} from 'react-native-worklets'; import Icon from '@components/Icon'; +import * as Expensicons from '@components/Icon/Expensicons'; import {easing} from '@components/Modal/ReanimatedModal/utils'; import {PressableWithFeedback} from '@components/Pressable'; -import {useMemoizedLazyExpensifyIcons} from '@hooks/useLazyAsset'; import useTheme from '@hooks/useTheme'; import useThemeStyles from '@hooks/useThemeStyles'; import CONST from '@src/CONST'; @@ -69,7 +69,6 @@ function AnimatedCollapsible({ const contentHeight = useSharedValue(0); const hasExpanded = useSharedValue(isExpanded); const [isRendered, setIsRendered] = React.useState(isExpanded); - const expensifyIcons = useMemoizedLazyExpensifyIcons(['DownArrow', 'UpArrow'] as const); useEffect(() => { hasExpanded.set(isExpanded); @@ -122,7 +121,7 @@ function AnimatedCollapsible({ > {({hovered}) => ( @@ -108,7 +107,7 @@ function ApprovalWorkflowSection({approvalWorkflow, onPress}: ApprovalWorkflowSe ))} diff --git a/src/components/Attachments/AttachmentCarousel/CarouselButtons.tsx b/src/components/Attachments/AttachmentCarousel/CarouselButtons.tsx index 05ba9019d1cb..04fd1163af44 100644 --- a/src/components/Attachments/AttachmentCarousel/CarouselButtons.tsx +++ b/src/components/Attachments/AttachmentCarousel/CarouselButtons.tsx @@ -2,8 +2,8 @@ import React from 'react'; import {View} from 'react-native'; import type {Attachment} from '@components/Attachments/types'; import Button from '@components/Button'; +import * as Expensicons from '@components/Icon/Expensicons'; import Tooltip from '@components/Tooltip'; -import {useMemoizedLazyExpensifyIcons} from '@hooks/useLazyAsset'; import useLocalize from '@hooks/useLocalize'; import useResponsiveLayout from '@hooks/useResponsiveLayout'; import useTheme from '@hooks/useTheme'; @@ -39,7 +39,6 @@ function CarouselButtons({page, attachments, shouldShowArrows, onBack, onForward const isForwardDisabled = page === attachments.length - 1; const {translate} = useLocalize(); const {shouldUseNarrowLayout} = useResponsiveLayout(); - const expensifyIcons = useMemoizedLazyExpensifyIcons(['ArrowRight', 'BackArrow'] as const); return shouldShowArrows ? ( <> @@ -49,7 +48,7 @@ function CarouselButtons({page, attachments, shouldShowArrows, onBack, onForward