Skip to content

Commit d4e9e82

Browse files
committed
Add reasonAttributes to ReportActionsListLoadingSkeleton in MoneyRequestReportActionsList
1 parent 2d63f2d commit d4e9e82

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
@@ -61,6 +61,7 @@ import {
6161
} from '@libs/ReportActionsUtils';
6262
import {canUserPerformWriteAction, chatIncludesChronosWithID, getOriginalReportID, getReportLastVisibleActionCreated, isHarvestCreatedExpenseReport, isUnread} from '@libs/ReportUtils';
6363
import markOpenReportEnd from '@libs/telemetry/markOpenReportEnd';
64+
import type {SkeletonSpanReasonAttributes} from '@libs/telemetry/useSkeletonSpan';
6465
import {isTransactionPendingDelete} from '@libs/TransactionUtils';
6566
import Visibility from '@libs/Visibility';
6667
import isSearchTopmostFullScreenRoute from '@navigation/helpers/isSearchTopmostFullScreenRoute';
@@ -343,6 +344,11 @@ function MoneyRequestReportActionsList({
343344
}, [reportActions, isOffline, canPerformWriteAction, reportTransactionIDs, shouldShowHarvestCreatedAction, visibleReportActionsData, reportID]);
344345

345346
const shouldShowOpenReportLoadingSkeleton = !isOffline && !!showReportActionsLoadingState && visibleReportActions.length === 0;
347+
const skeletonReasonAttributes: SkeletonSpanReasonAttributes = {
348+
context: 'MoneyRequestReportActionsList',
349+
isOffline,
350+
showReportActionsLoadingState: !!showReportActionsLoadingState,
351+
};
346352
useEffect(() => {
347353
if (!shouldShowOpenReportLoadingSkeleton) {
348354
return;
@@ -885,7 +891,7 @@ function MoneyRequestReportActionsList({
885891
onScroll={trackVerticalScrolling}
886892
contentContainerStyle={[shouldUseNarrowLayout ? styles.pt4 : styles.pt2]}
887893
ref={reportScrollManager.ref}
888-
ListEmptyComponent={!isOffline && showReportActionsLoadingState ? <ReportActionsListLoadingSkeleton /> : undefined} // This skeleton component is only used for loading state, the empty state is handled by SearchMoneyRequestReportEmptyState
894+
ListEmptyComponent={!isOffline && showReportActionsLoadingState ? <ReportActionsListLoadingSkeleton reasonAttributes={skeletonReasonAttributes} /> : undefined} // This skeleton component is only used for loading state, the empty state is handled by SearchMoneyRequestReportEmptyState
889895
removeClippedSubviews={false}
890896
initialScrollKey={linkedReportActionID}
891897
/>

0 commit comments

Comments
 (0)