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 @@ -130,7 +130,7 @@ function ExpenseReportListItemRow({
<UserInfoCell
accountID={item.from.accountID}
avatar={item.from.avatar}
displayName={item.from.displayName ?? item.from.login ?? ''}
displayName={item.formattedFrom ?? ''}
/>
)}
</View>
Expand All @@ -141,7 +141,7 @@ function ExpenseReportListItemRow({
<UserInfoCell
accountID={item.to.accountID}
avatar={item.to.avatar}
displayName={item.to.displayName ?? item.to.login ?? ''}
displayName={item.formattedTo ?? ''}
/>
)}
</View>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import React from 'react';
import {View} from 'react-native';
import type {StyleProp, ViewStyle} from 'react-native';
import type {TransactionListItemType, TransactionReportGroupListItemType} from '@components/SelectionListWithSections/types';
import useLocalize from '@hooks/useLocalize';
import useOnyx from '@hooks/useOnyx';
import useResponsiveLayout from '@hooks/useResponsiveLayout';
import useThemeStyles from '@hooks/useThemeStyles';
Expand All @@ -29,13 +28,12 @@ function UserInfoAndActionButtonRow({
}) {
const styles = useThemeStyles();
const {isLargeScreenWidth} = useResponsiveLayout();
const {translate} = useLocalize();
const transactionItem = item as unknown as TransactionListItemType;
const [isActionLoading] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_METADATA}${transactionItem.reportID}`, {canBeMissing: true, selector: isActionLoadingSelector});
const hasFromSender = !!item?.from && !!item?.from?.accountID && !!item?.from?.displayName;
const hasToRecipient = !!item?.to && !!item?.to?.accountID && !!item?.to?.displayName;
const participantFromDisplayName = item?.from?.displayName ?? item?.from?.login ?? translate('common.hidden');
const participantToDisplayName = item?.to?.displayName ?? item?.to?.login ?? translate('common.hidden');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm confused about why we got rid of the common.hidden translation here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The formattedFrom and formattedTo uses getDisplayNameOrDefault which already handle the hidden logic.

const fromName = getDisplayNameOrDefault(from);
const formattedFrom = formatPhoneNumber(fromName);

This is also consistent with TransactionItemRow component which is being used on the large screen.

displayName={transactionItem.formattedFrom ?? transactionItem.from.displayName ?? ''}

const participantFromDisplayName = item.formattedFrom ?? item?.from?.displayName ?? '';
const participantToDisplayName = item.formattedTo ?? item?.to?.displayName ?? '';
const shouldShowToRecipient = hasFromSender && hasToRecipient && !!item?.to?.accountID && !!isCorrectSearchUserName(participantToDisplayName);
return (
<View
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import {Str} from 'expensify-common';
import React from 'react';
import {View} from 'react-native';
import Avatar from '@components/Avatar';
Expand Down Expand Up @@ -108,10 +109,10 @@ function WorkspaceCompanyCardTableItem({
}

const lastCardNumbers = isPlaidCardFeed ? lastFourNumbersFromCardName(cardName) : splitMaskedCardNumber(cardName)?.lastDigits;
const cardholderLoginText = !shouldUseNarrowTableLayout && isAssigned ? cardholder?.login : undefined;
const cardholderLoginText = !shouldUseNarrowTableLayout && isAssigned ? Str.removeSMSDomain(cardholder?.login ?? '') : undefined;
const narrowWidthCardName = isAssigned ? `${customCardName ?? ''}${lastCardNumbers ? ` - ${lastCardNumbers}` : ''}` : cardName;

const leftColumnTitle = isAssigned ? (cardholder?.displayName ?? '') : translate('workspace.moreFeatures.companyCards.unassignedCards');
const leftColumnTitle = isAssigned ? Str.removeSMSDomain(cardholder?.displayName ?? '') : translate('workspace.moreFeatures.companyCards.unassignedCards');
const leftColumnSubtitle = shouldUseNarrowTableLayout ? narrowWidthCardName : cardholderLoginText;

const resetFailedCompanyCardAssignment = () => {
Expand Down
Loading