Skip to content

Commit da28c7f

Browse files
authored
Merge pull request Expensify#83685 from callstack-internal/fix/report-actions-list-loading-skeleton-reason-attributes
[No QA] Add reasonAttributes to ReportActionsListLoadingSkeleton usage site
2 parents 2460ba8 + d4e9e82 commit da28c7f

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/components/MoneyRequestReportView/MoneyRequestReportActionsList.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ import {
6060
} from '@libs/ReportActionsUtils';
6161
import {canUserPerformWriteAction, chatIncludesChronosWithID, getOriginalReportID, getReportLastVisibleActionCreated, isHarvestCreatedExpenseReport, isUnread} from '@libs/ReportUtils';
6262
import markOpenReportEnd from '@libs/telemetry/markOpenReportEnd';
63+
import type {SkeletonSpanReasonAttributes} from '@libs/telemetry/useSkeletonSpan';
6364
import {isTransactionPendingDelete} from '@libs/TransactionUtils';
6465
import Visibility from '@libs/Visibility';
6566
import isSearchTopmostFullScreenRoute from '@navigation/helpers/isSearchTopmostFullScreenRoute';
@@ -346,6 +347,11 @@ function MoneyRequestReportActionsList({
346347
}, [reportActions, isOffline, canPerformWriteAction, reportTransactionIDs, shouldShowHarvestCreatedAction, visibleReportActionsData, reportID]);
347348

348349
const shouldShowOpenReportLoadingSkeleton = !isOffline && !!showReportActionsLoadingState && visibleReportActions.length === 0;
350+
const skeletonReasonAttributes: SkeletonSpanReasonAttributes = {
351+
context: 'MoneyRequestReportActionsList',
352+
isOffline,
353+
showReportActionsLoadingState: !!showReportActionsLoadingState,
354+
};
349355
useEffect(() => {
350356
if (!shouldShowOpenReportLoadingSkeleton) {
351357
return;
@@ -890,7 +896,7 @@ function MoneyRequestReportActionsList({
890896
onScroll={trackVerticalScrolling}
891897
contentContainerStyle={[shouldUseNarrowLayout ? styles.pt4 : styles.pt3]}
892898
ref={reportScrollManager.ref}
893-
ListEmptyComponent={!isOffline && showReportActionsLoadingState ? <ReportActionsListLoadingSkeleton /> : undefined} // This skeleton component is only used for loading state, the empty state is handled by SearchMoneyRequestReportEmptyState
899+
ListEmptyComponent={!isOffline && showReportActionsLoadingState ? <ReportActionsListLoadingSkeleton reasonAttributes={skeletonReasonAttributes} /> : undefined} // This skeleton component is only used for loading state, the empty state is handled by SearchMoneyRequestReportEmptyState
894900
removeClippedSubviews={false}
895901
initialScrollKey={linkedReportActionID}
896902
/>

0 commit comments

Comments
 (0)