Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import useTheme from '@hooks/useTheme';
import useThemeStyles from '@hooks/useThemeStyles';
import {formatMaskedCardName, getCardFeedWithDomainID, lastFourNumbersFromCardName, splitMaskedCardNumber} from '@libs/CardUtils';
import Navigation from '@libs/Navigation/Navigation';
import type {SkeletonSpanReasonAttributes} from '@libs/telemetry/useSkeletonSpan';
import {getDefaultAvatarURL} from '@libs/UserAvatarUtils';
import CONST from '@src/CONST';
import ROUTES from '@src/ROUTES';
Expand Down Expand Up @@ -94,6 +95,11 @@ function WorkspaceCompanyCardTableItem({
const assignCard = () => onAssignCard(cardName, encryptedCardNumber);
const isDeleting = !isOffline && pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE;

const reasonAttributes: SkeletonSpanReasonAttributes = {
context: 'WorkspaceCompanyCardsTableItem',
isDeleting,
};

return (
<OfflineWithFeedback
errorRowStyles={[styles.ph5, styles.mb4]}
Expand All @@ -107,6 +113,7 @@ function WorkspaceCompanyCardTableItem({
<TableRowSkeleton
fixedNumItems={1}
useCompanyCardsLayout
reasonAttributes={reasonAttributes}
/>
</View>
) : (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import useResponsiveLayout from '@hooks/useResponsiveLayout';
import useThemeStyles from '@hooks/useThemeStyles';
import {resetFailedWorkspaceCompanyCardUnassignment} from '@libs/actions/CompanyCards';
import {getDefaultCardName, getPlaidInstitutionId} from '@libs/CardUtils';
import type {SkeletonSpanReasonAttributes} from '@libs/telemetry/useSkeletonSpan';
import tokenizedSearch from '@libs/tokenizedSearch';
import WorkspaceCompanyCardPageEmptyState from '@pages/workspace/companyCards/WorkspaceCompanyCardPageEmptyState';
import WorkspaceCompanyCardsFeedAddedEmptyPage from '@pages/workspace/companyCards/WorkspaceCompanyCardsFeedAddedEmptyPage';
Expand Down Expand Up @@ -330,6 +331,12 @@ function WorkspaceCompanyCardsTable({
</View>
) : undefined;

const reasonAttributes: SkeletonSpanReasonAttributes = {
context: 'WorkspaceCompanyCardsTable',
isLoading,
isLoadingCards,
};

return (
<Table
ref={tableRef}
Expand All @@ -342,14 +349,28 @@ function WorkspaceCompanyCardsTable({
isItemInFilter={isItemInFilter}
filters={filterConfig}
initialSortColumn="member"
ListEmptyComponent={isLoadingCards ? <TableRowSkeleton fixedNumItems={5} /> : <WorkspaceCompanyCardsFeedAddedEmptyPage shouldShowGBDisclaimer={shouldShowGBDisclaimer} />}
ListEmptyComponent={
isLoadingCards ? (
<TableRowSkeleton
fixedNumItems={5}
reasonAttributes={reasonAttributes}
/>
) : (
<WorkspaceCompanyCardsFeedAddedEmptyPage shouldShowGBDisclaimer={shouldShowGBDisclaimer} />
)
}
ListHeaderComponent={shouldUseNarrowTableLayout ? headerButtonsComponent : undefined}
>
{shouldRenderHeaderAsChild && headerButtonsComponent}

{(isLoading || isFeedPending || isNoFeed) && !feedErrorKey && (
<ScrollView>
{isLoading && <TableRowSkeleton fixedNumItems={5} />}
{isLoading && (
<TableRowSkeleton
fixedNumItems={5}
reasonAttributes={reasonAttributes}
/>
)}

{!isLoading && isFeedPending && (
<View style={styles.flex1}>
Expand Down
Loading