Skip to content

Commit

Permalink
Resolve conflict add comment to PureReportActionItem
Browse files Browse the repository at this point in the history
  • Loading branch information
wildan-m committed Dec 13, 2024
1 parent 0f30572 commit a5323be
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/pages/home/report/PureReportActionItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import ControlSelection from '@libs/ControlSelection';
import * as DeviceCapabilities from '@libs/DeviceCapabilities';
import * as ErrorUtils from '@libs/ErrorUtils';
import focusComposerWithDelay from '@libs/focusComposerWithDelay';
import * as LocalePhoneNumber from '@libs/LocalePhoneNumber';
import Navigation from '@libs/Navigation/Navigation';
import Permissions from '@libs/Permissions';
import * as PersonalDetailsUtils from '@libs/PersonalDetailsUtils';
Expand Down Expand Up @@ -241,6 +242,11 @@ type PureReportActionItemProps = {
reportAutomaticallyForwardedMessage?: string;
};

/**
* This is a pure version of ReportActionItem, used in ReportActionList and Search result chat list items.
* Since the search result has a separate Onyx key under the 'snapshot_' prefix, we should not connect this component with Onyx.
* Instead, pass all Onyx read/write operations as props.
*/
function PureReportActionItem({
action,
report,
Expand Down Expand Up @@ -713,7 +719,7 @@ function PureReportActionItem({
);
} else if (ReportActionsUtils.isReimbursementQueuedAction(action)) {
const linkedReport = ReportUtils.isChatThread(report) ? parentReport : report;
const submitterDisplayName = PersonalDetailsUtils.getDisplayNameOrDefault(personalDetails?.[linkedReport?.ownerAccountID ?? -1]);
const submitterDisplayName = LocalePhoneNumber.formatPhoneNumber(PersonalDetailsUtils.getDisplayNameOrDefault(personalDetails?.[linkedReport?.ownerAccountID ?? -1]));
const paymentType = ReportActionsUtils.getOriginalMessage(action)?.paymentType ?? '';

children = (
Expand Down
2 changes: 1 addition & 1 deletion src/pages/home/report/ReportActionItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function ReportActionItem({action, report, ...props}: PureReportActionItemProps)
const blockedFromConcierge = useBlockedFromConcierge();
const [userBillingFundID] = useOnyx(ONYXKEYS.NVP_BILLING_FUND_ID);
const linkedReport = ReportUtils.isChatThread(report) ? parentReport : report;
const missingPaymentMethod = ReportUtils.getIndicatedMissingPaymentMethod?.(userWallet, linkedReport?.reportID ?? '-1', action);
const missingPaymentMethod = ReportUtils.getIndicatedMissingPaymentMethod(userWallet, linkedReport?.reportID ?? '-1', action);

return (
<PureReportActionItem
Expand Down

0 comments on commit a5323be

Please sign in to comment.