Skip to content

Commit

Permalink
Merge pull request Expensify#51671 from callstack-internal/VickyStash…
Browse files Browse the repository at this point in the history
…/bugfix/51660-wallet-clean-up

[Custom feeds] Clean up for the wallet and workspace member page
  • Loading branch information
mountiny authored Nov 4, 2024
2 parents 1375a4e + 37dbfa8 commit bcb9bfa
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
17 changes: 10 additions & 7 deletions src/pages/settings/Wallet/PaymentMethodList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ import type {ValueOf} from 'type-fest';
import type {RenderSuggestionMenuItemProps} from '@components/AutoCompleteSuggestions/types';
import Button from '@components/Button';
import FormAlertWrapper from '@components/FormAlertWrapper';
import getBankIcon from '@components/Icon/BankIcons';
import type {BankName} from '@components/Icon/BankIconsUtils';
import * as Expensicons from '@components/Icon/Expensicons';
import MenuItem from '@components/MenuItem';
import OfflineWithFeedback from '@components/OfflineWithFeedback';
Expand All @@ -30,7 +28,7 @@ import * as PaymentMethods from '@userActions/PaymentMethods';
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
import ROUTES from '@src/ROUTES';
import type {AccountData} from '@src/types/onyx';
import type {AccountData, CompanyCardFeed} from '@src/types/onyx';
import type {BankIcon} from '@src/types/onyx/Bank';
import type {Errors} from '@src/types/onyx/OnyxCommon';
import type PaymentMethod from '@src/types/onyx/PaymentMethod';
Expand Down Expand Up @@ -223,12 +221,12 @@ function PaymentMethodList({

const assignedCardsGrouped: PaymentMethodItem[] = [];
assignedCardsSorted.forEach((card) => {
const icon = getBankIcon({bankName: card.bank as BankName, isCard: true, styles});
const icon = CardUtils.getCardFeedIcon(card.bank as CompanyCardFeed);

if (!CardUtils.isExpensifyCard(card.cardID)) {
assignedCardsGrouped.push({
key: card.cardID.toString(),
title: card.bank,
title: card.cardName,
description: getDescriptionForPolicyDomainCard(card.domainName),
shouldShowRightIcon: false,
interactive: false,
Expand All @@ -238,7 +236,9 @@ function PaymentMethodList({
card.fraud === CONST.EXPENSIFY_CARD.FRAUD_TYPES.DOMAIN || card.fraud === CONST.EXPENSIFY_CARD.FRAUD_TYPES.INDIVIDUAL
? CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR
: undefined,
...icon,
icon,
iconStyles: [styles.assignedCardsIconContainer],
iconSize: variables.iconSizeExtraLarge,
});
return;
}
Expand Down Expand Up @@ -275,7 +275,10 @@ function PaymentMethodList({
card.fraud === CONST.EXPENSIFY_CARD.FRAUD_TYPES.DOMAIN || card.fraud === CONST.EXPENSIFY_CARD.FRAUD_TYPES.INDIVIDUAL
? CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR
: undefined,
...icon,
icon,
iconStyles: [styles.assignedCardsIconContainer],
iconWidth: variables.bankCardWidth,
iconHeight: variables.bankCardHeight,
});
});
return assignedCardsGrouped;
Expand Down
4 changes: 2 additions & 2 deletions src/pages/workspace/members/WorkspaceMemberDetailsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -328,8 +328,8 @@ function WorkspaceMemberDetailsPage({personalDetails, policy, route}: WorkspaceM
displayInDefaultIconColor
iconStyles={styles.cardIcon}
contentFit="contain"
iconWidth={variables.cardIconWidth}
iconHeight={variables.cardIconHeight}
iconWidth={variables.iconSizeExtraLarge}
iconHeight={variables.iconSizeExtraLarge}
onPress={() => navigateToDetails(memberCard)}
shouldShowRightIcon
/>
Expand Down

0 comments on commit bcb9bfa

Please sign in to comment.