Skip to content

Commit ba57e9c

Browse files
committed
make two types more distinct
1 parent bf1279d commit ba57e9c

1 file changed

Lines changed: 25 additions & 21 deletions

File tree

src/pages/settings/Wallet/PaymentMethodListItem.tsx

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,11 @@ function PaymentMethodListItem({item, shouldShowDefaultBadge, threeDotsMenuItems
139139
}
140140
};
141141

142+
// Account-level status badges (right side of the row)
142143
const badgeText = useMemo(() => {
143144
if (isInLockedState) {
144145
return translate('common.locked');
145146
}
146-
147147
if (isInSetupState) {
148148
return translate('common.actionRequired');
149149
}
@@ -157,26 +157,30 @@ function PaymentMethodListItem({item, shouldShowDefaultBadge, threeDotsMenuItems
157157
return undefined;
158158
}, [icons.DotIndicator, isInSetupState, isInLockedState]);
159159

160-
let descriptionAddon;
161-
if (item.isCardFrozen) {
162-
descriptionAddon = (
163-
<Badge
164-
text={translate('cardPage.frozen')}
165-
icon={icons.FreezeCard}
166-
isCondensed
167-
badgeStyles={[styles.ml0]}
168-
iconStyles={[styles.mr1]}
169-
/>
170-
);
171-
} else if (item.isSuspended) {
172-
descriptionAddon = (
173-
<Badge
174-
text={translate('walletPage.cardInactive')}
175-
isCondensed
176-
badgeStyles={[styles.ml0]}
177-
/>
178-
);
179-
}
160+
// Card state pills (below title, next to description)
161+
const descriptionAddon = useMemo(() => {
162+
if (item.isCardFrozen) {
163+
return (
164+
<Badge
165+
text={translate('cardPage.frozen')}
166+
icon={icons.FreezeCard}
167+
isCondensed
168+
badgeStyles={[styles.ml0]}
169+
iconStyles={[styles.mr1]}
170+
/>
171+
);
172+
}
173+
if (item.isSuspended) {
174+
return (
175+
<Badge
176+
text={translate('walletPage.cardInactive')}
177+
isCondensed
178+
badgeStyles={[styles.ml0]}
179+
/>
180+
);
181+
}
182+
return undefined;
183+
}, [item.isCardFrozen, item.isSuspended, icons.FreezeCard, styles.ml0, styles.mr1, translate]);
180184

181185
return (
182186
<OfflineWithFeedback

0 commit comments

Comments
 (0)