Skip to content

Commit

Permalink
Merge pull request Expensify#52625 from callstack-internal/show-corre…
Browse files Browse the repository at this point in the history
…ct-card-name-for-company-cards-search

[Internal QA]: Show card name instead of Bank for Company cards search
  • Loading branch information
mountiny authored Nov 19, 2024
2 parents 9268594 + a0ec0c4 commit 3d95e82
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import type {CategorySection} from '@libs/OptionsListUtils';
import type {OptionData} from '@libs/ReportUtils';
import Navigation from '@navigation/Navigation';
import * as SearchActions from '@userActions/Search';
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
import ROUTES from '@src/ROUTES';

Expand All @@ -32,11 +33,13 @@ function SearchFiltersCardPage() {
.sort((a, b) => a.bank.localeCompare(b.bank))
.map((card) => {
const icon = getBankIcon({bankName: card.bank as BankName, isCard: true, styles});
const cardName = card?.nameValuePairs?.cardTitle ?? card?.cardName;
const text = card.bank === CONST.EXPENSIFY_CARD.BANK ? card.bank : cardName;

return {
lastFourPAN: card.lastFourPAN,
isVirtual: card?.nameValuePairs?.isVirtual,
text: card.bank,
text,
keyForList: card.cardID.toString(),
isSelected: newCards.includes(card.cardID.toString()),
bankIcon: icon,
Expand Down

0 comments on commit 3d95e82

Please sign in to comment.