@@ -9,12 +9,14 @@ import {useMemoizedLazyExpensifyIcons} from '@hooks/useLazyAsset';
99import useLocalize from '@hooks/useLocalize' ;
1010import useTheme from '@hooks/useTheme' ;
1111import useThemeStyles from '@hooks/useThemeStyles' ;
12+ import { getCardFeedWithDomainID } from '@libs/CardUtils' ;
1213import { convertToDisplayString } from '@libs/CurrencyUtils' ;
1314import Navigation from '@libs/Navigation/Navigation' ;
1415import variables from '@styles/variables' ;
1516import ROUTES from '@src/ROUTES' ;
1617import RemainingLimitCircle from './RemainingLimitCircle' ;
1718import type { useYourSpendData } from './useYourSpendData' ;
19+ import { YOUR_SPEND_CARD_KIND } from './useYourSpendData' ;
1820
1921type CardRowProps = {
2022 cardRow : ReturnType < typeof useYourSpendData > [ 'cardRows' ] [ number ] ;
@@ -31,6 +33,41 @@ function CardRow({cardRow, wrapperStyle}: CardRowProps) {
3133
3234 const cardTotal = cardRow . total !== undefined ? convertToDisplayString ( cardRow . total , cardRow . currency ) : undefined ;
3335
36+ // Pick the artwork branch up front so the JSX below stays readable.
37+ // - Expensify Card: keep the existing illustrated feed icon.
38+ // - Third-party with `fundID`: employer-feed company card → `feed|domainID` key.
39+ // - Third-party without `fundID`: personal Plaid card → pass the bare `bank`
40+ // (`plaid.ins_…`) directly. `CardFeedIcon` resolves the Plaid institution icon
41+ // internally via `getPlaidInstitutionId(selectedFeed)`.
42+ const iconProps = {
43+ width : variables . cardIconWidth ,
44+ height : variables . cardIconHeight ,
45+ additionalStyles : [ styles . overflowHidden , styles . br1 ] ,
46+ } ;
47+ let leftIcon : React . ReactElement ;
48+ if ( cardRow . kind === YOUR_SPEND_CARD_KIND . EXPENSIFY ) {
49+ leftIcon = (
50+ < CardFeedIcon
51+ isExpensifyCardFeed
52+ iconProps = { iconProps }
53+ />
54+ ) ;
55+ } else if ( cardRow . fundID !== undefined ) {
56+ leftIcon = (
57+ < CardFeedIcon
58+ selectedFeed = { getCardFeedWithDomainID ( cardRow . bank , cardRow . fundID ) }
59+ iconProps = { iconProps }
60+ />
61+ ) ;
62+ } else {
63+ leftIcon = (
64+ < CardFeedIcon
65+ selectedFeed = { cardRow . bank }
66+ iconProps = { iconProps }
67+ />
68+ ) ;
69+ }
70+
3471 return (
3572 < View
3673 testID = { `your-spend-card-row-${ cardRow . cardID } ` }
@@ -56,18 +93,7 @@ function CardRow({cardRow, wrapperStyle}: CardRowProps) {
5693 </ View >
5794 </ View >
5895 }
59- leftComponent = {
60- < View style = { [ styles . justifyContentCenter , styles . h10 ] } >
61- < CardFeedIcon
62- isExpensifyCardFeed
63- iconProps = { {
64- width : variables . cardIconWidth ,
65- height : variables . cardIconHeight ,
66- additionalStyles : [ styles . overflowHidden , styles . br1 ] ,
67- } }
68- />
69- </ View >
70- }
96+ leftComponent = { < View style = { [ styles . justifyContentCenter , styles . h10 ] } > { leftIcon } </ View > }
7197 wrapperStyle = { wrapperStyle }
7298 hasSubMenuItems
7399 shouldCheckActionAllowedOnPress = { false }
0 commit comments