Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
c6f8fc9
remove loading from table row
JS00001 Jun 19, 2026
ea4ba73
remove props
JS00001 Jun 19, 2026
4281925
Merge branch 'main' of github.com:Expensify/App into jsenyitko-loadin…
JS00001 Jun 23, 2026
ab677a2
add loading spiner hrer
JS00001 Jun 23, 2026
bc555d1
remove offline deleted items
JS00001 Jun 23, 2026
81c29d6
remove usless ternary
JS00001 Jun 24, 2026
f04bab7
Merge branch 'main' of github.com:Expensify/App into jsenyitko-loadin…
JS00001 Jun 24, 2026
f32176a
remove more instances of spinny
JS00001 Jun 24, 2026
1adeb3a
clenaup component
JS00001 Jun 24, 2026
241b46d
Merge branch 'main' of github.com:Expensify/App into jsenyitko-loadin…
JS00001 Jun 24, 2026
858bb1f
remove taxes table loading state
JS00001 Jun 24, 2026
9a41cee
add back empty loading state
JS00001 Jun 24, 2026
f18fe97
remove excess props
JS00001 Jun 24, 2026
0746664
Merge branch 'main' of github.com:Expensify/App into jsenyitko-loadin…
JS00001 Jun 25, 2026
36edb4c
address commenbts
JS00001 Jun 25, 2026
00badfc
Merge branch 'main' of github.com:Expensify/App into jsenyitko-loadin…
JS00001 Jun 26, 2026
8f19331
remove old values
JS00001 Jun 26, 2026
9df0584
Merge branch 'main' of github.com:Expensify/App into jsenyitko-loadin…
JS00001 Jun 26, 2026
eed8452
fix types
JS00001 Jun 26, 2026
eaafcf2
fix types again & update flex layout
JS00001 Jun 26, 2026
3d45d06
update flex
JS00001 Jun 26, 2026
2c1997c
Merge branch 'main' of github.com:Expensify/App into jsenyitko-loadin…
JS00001 Jun 29, 2026
faf5feb
update flex
JS00001 Jun 29, 2026
f4c7380
Merge branch 'main' of github.com:Expensify/App into jsenyitko-loadin…
JS00001 Jun 29, 2026
da2e603
Merge branch 'main' of github.com:Expensify/App into jsenyitko-loadin…
JS00001 Jun 29, 2026
5d3fb0c
fix ts
JS00001 Jun 29, 2026
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
72 changes: 21 additions & 51 deletions src/components/Table/TableRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,11 @@ import type {OfflineWithFeedbackProps} from '@components/OfflineWithFeedback';
import OfflineWithFeedback from '@components/OfflineWithFeedback';
import type {PressableWithFeedbackProps} from '@components/Pressable/PressableWithFeedback';
import PressableWithFeedback from '@components/Pressable/PressableWithFeedback';
import SkeletonViewContentLoader from '@components/SkeletonViewContentLoader';
import useAnimatedHighlightStyle from '@hooks/useAnimatedHighlightStyle';
import useLocalize from '@hooks/useLocalize';
import useResponsiveLayout from '@hooks/useResponsiveLayout';
import useTheme from '@hooks/useTheme';
import useThemeStyles from '@hooks/useThemeStyles';
import type {SkeletonSpanReasonAttributes} from '@libs/telemetry/useSkeletonSpan';
import useSkeletonSpan from '@libs/telemetry/useSkeletonSpan';
import variables from '@styles/variables';
import CONST from '@src/CONST';
import {useTableContext} from './TableContext';
Expand All @@ -33,15 +30,6 @@ type TableRowProps = Omit<PressableWithFeedbackProps, 'accessible'> & {
/** The index of the row in the table */
rowIndex: number;

/** Whether or not the table row is loading */
isLoading?: boolean;

/** The loading component to render within the table row when the row is loading */
LoadingComponent?: React.ComponentType;

/** The reason attributes if the table row is loading */
skeletonReasonAttributes: SkeletonSpanReasonAttributes;

/** Attributes for when the client is offline and there is an error related to the table row */
offlineWithFeedback?: OfflineWithFeedbackProps;

Expand All @@ -59,17 +47,12 @@ export default function TableRow({
disabled,
sentryLabel,
interactive,
isLoading,
skeletonReasonAttributes,
LoadingComponent,
onPress,
offlineWithFeedback,
checkboxReplacementElement,
rowFooter,
...props
}: TableRowProps) {
useSkeletonSpan('TableRowSkeleton', skeletonReasonAttributes);

const theme = useTheme();
const styles = useThemeStyles();
const {translate} = useLocalize();
Expand All @@ -79,12 +62,13 @@ export default function TableRow({

const item = processedData.at(rowIndex);
const rowCount = processedData.length;
const isFirstRow = rowIndex === 0;
const isLastRow = rowIndex === rowCount - 1;
const isDisabled = !!disabled || !!isLoading;
const gridTemplateColumns = columns.map((column) => (column.width ? `${column.width}px` : '1fr'));
const isSelectionCheckboxVisible = selectionEnabled && (isMobileSelectionEnabled || !shouldUseNarrowLayout);

const isDisabled = !!disabled;
const isFirstRow = rowIndex === 0;
const isLastRow = rowIndex === rowCount - 1;

if (selectionEnabled && isSelectionCheckboxVisible) {
gridTemplateColumns.unshift(`${variables.tableCheckboxColumnWidth}px`);
}
Expand Down Expand Up @@ -112,11 +96,10 @@ export default function TableRow({
const tableRowContentContainerStyles = [
styles.flex1,
styles.gap3,
shouldUseNarrowTableLayout ? styles.ph4 : styles.ph3,
shouldUseNarrowTableLayout && !isLoading && styles.pv4,
!shouldUseNarrowTableLayout && !isLoading && styles.pv2,
animatedHighlightStyle,
isLastRow && styles.tableBottomRadius,
shouldUseNarrowTableLayout ? styles.ph4 : styles.ph3,
shouldUseNarrowTableLayout ? styles.pv4 : styles.pv2,
];

const tableRowContentStyles = [
Expand Down Expand Up @@ -224,34 +207,21 @@ export default function TableRow({
>
{(state) => (
<Animated.View style={tableRowContentContainerStyles}>
{!!isLoading && LoadingComponent ? (
<View style={[styles.flexRow, styles.alignItemsCenter, styles.flex1]}>
<SkeletonViewContentLoader
width="100%"
backgroundColor={theme.skeletonLHNIn}
foregroundColor={theme.skeletonLHNOut}
height={variables.tableSkeletonHeight}
Comment thread
JS00001 marked this conversation as resolved.
>
<LoadingComponent />
</SkeletonViewContentLoader>
</View>
) : (
<View style={tableRowContentStyles}>
{!!isSelectionCheckboxVisible &&
(checkboxReplacementElement ?? (
<Checkbox
shouldStopMouseDownPropagation
containerStyle={styles.m0}
style={styles.flex1}
isChecked={!!item.selected}
disabled={!!item.disabled || !!item.isSelectionDisabled}
accessibilityLabel={translate('common.select')}
onPress={(event) => handleCheckboxPress(event)}
/>
))}
{renderChildren(state)}
</View>
)}
<View style={tableRowContentStyles}>
{!!isSelectionCheckboxVisible &&
(checkboxReplacementElement ?? (
<Checkbox
shouldStopMouseDownPropagation
containerStyle={styles.m0}
style={styles.flex1}
isChecked={!!item.selected}
disabled={!!item.disabled || !!item.isSelectionDisabled}
accessibilityLabel={translate('common.select')}
onPress={(event) => handleCheckboxPress(event)}
/>
))}
{renderChildren(state)}
</View>

{rowFooter}

Expand Down
59 changes: 0 additions & 59 deletions src/components/Table/TableSkeleton.tsx

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ export default function DomainAdminsTableRow({item, rowIndex, shouldUseNarrowTab
rowIndex={rowIndex}
disabled={item.disabled}
accessibilityLabel={accessibilityLabel}
skeletonReasonAttributes={{context: 'domainAdminsTableRow'}}
sentryLabel={CONST.SENTRY_LABEL.DOMAIN.ADMINS.ROW}
offlineWithFeedback={{
errors: item.errors,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ export default function DomainGroupsTableRow({item, rowIndex, shouldUseNarrowTab
rowIndex={rowIndex}
disabled={item.disabled}
accessibilityLabel={accessibilityLabel}
skeletonReasonAttributes={{context: 'domainGroupsTableRow'}}
offlineWithFeedback={{
errors: item.errors,
pendingAction: item.pendingAction,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ export default function DomainListTableRow({item, rowIndex, shouldUseNarrowTable
onPress={item.action}
disabled={item.disabled}
accessibilityLabel={accessibilityLabel}
skeletonReasonAttributes={{context: 'domainTableRow'}}
offlineWithFeedback={{
errors: item.errors,
pendingAction: item.pendingAction,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ export default function DomainMembersTableRow({item, rowIndex, shouldUseNarrowTa
rowIndex={rowIndex}
disabled={item.disabled}
accessibilityLabel={accessibilityLabel}
skeletonReasonAttributes={{context: 'domainMembersTableRow'}}
sentryLabel={CONST.SENTRY_LABEL.DOMAIN.MEMBERS.ROW}
offlineWithFeedback={{
errors: item.errors,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ export default function WorkspaceCategoriesTableRow({rowIndex, shouldUseNarrowTa
rowIndex={rowIndex}
disabled={item.disabled}
accessibilityLabel={accessibilityLabel}
skeletonReasonAttributes={{context: 'categoriesTableRow'}}
sentryLabel={CONST.SENTRY_LABEL.WORKSPACE.CATEGORIES.ROW}
onPress={item.action}
offlineWithFeedback={{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,15 @@ import Text from '@components/Text';
import TextWithTooltip from '@components/TextWithTooltip';
import {useMemoizedLazyExpensifyIcons} from '@hooks/useLazyAsset';
import useLocalize from '@hooks/useLocalize';
import useNetwork from '@hooks/useNetwork';
import useTheme from '@hooks/useTheme';
import useThemeStyles from '@hooks/useThemeStyles';
import {formatMaskedCardName} from '@libs/CardUtils';
import Navigation from '@libs/Navigation/Navigation';
import type {SkeletonSpanReasonAttributes} from '@libs/telemetry/useSkeletonSpan';
import variables from '@styles/variables';
import CONST from '@src/CONST';
import ROUTES from '@src/ROUTES';
import type {Card, CompanyCardFeed, CompanyCardFeedWithDomainID} from '@src/types/onyx';
import type {CardAssignmentData} from '@src/types/onyx/Card';
import WorkspaceCompanyCardsTableSkeleton from './WorkspaceCompanyCardsTableSkeleton';

type WorkspaceCompanyCardTableRowData = TableData &
CardAssignmentData & {
Expand Down Expand Up @@ -84,14 +81,11 @@ function WorkspaceCompanyCardTableRow({
}: WorkspaceCompanyCardTableRowProps) {
const theme = useTheme();
const styles = useThemeStyles();
const {isOffline} = useNetwork();
const {translate} = useLocalize();
const Expensicons = useMemoizedLazyExpensifyIcons(['ArrowRight']);

const {cardName, encryptedCardNumber, customCardName, cardholder, assignedCard, isAssigned, errors, pendingAction, isCardDeleted, onDismissError} = item;

const isDeleting = !isOffline && pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE;

const formattedCustomCardName = customCardName ?? '';
const formattedCardDetails = formatMaskedCardName(cardName);
const formattedCustomCardNameSuffix = formattedCustomCardName ? ` • ${formattedCustomCardName}` : '';
Expand All @@ -102,11 +96,6 @@ function WorkspaceCompanyCardTableRow({
const memberColumnTitle = isAssigned ? Str.removeSMSDomain(cardholder?.displayName ?? '') : translate('workspace.moreFeatures.companyCards.unassignedCards');
const memberCardSubtitle = shouldUseNarrowTableLayout ? narrowWidthCardName : cardholderLoginText;

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

const avatarSize = shouldUseNarrowTableLayout ? CONST.AVATAR_SIZE.DEFAULT : CONST.AVATAR_SIZE.SMALL;
const subscriptCardFeedIconSize = shouldUseNarrowTableLayout
? {width: variables.cardAvatarWidth, height: variables.cardAvatarHeight}
Expand Down Expand Up @@ -138,11 +127,8 @@ function WorkspaceCompanyCardTableRow({
<Table.Row
interactive
rowIndex={rowIndex}
isLoading={isDeleting}
disabled={isCardDeleted || !canPressRow}
skeletonReasonAttributes={reasonAttributes}
sentryLabel={CONST.SENTRY_LABEL.WORKSPACE.COMPANY_CARDS.TABLE_ITEM}
LoadingComponent={WorkspaceCompanyCardsTableSkeleton}
offlineWithFeedback={{errors, pendingAction, onClose: onDismissError, shouldHideOnDelete: false}}
onPress={handleRowPress}
>
Expand Down

This file was deleted.

Loading
Loading