Skip to content
Open
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
7 changes: 0 additions & 7 deletions src/pages/settings/Wallet/ExpensifyCardPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -453,13 +453,6 @@ function ExpensifyCardPage({route}: ExpensifyCardPageProps) {
}
Navigation.navigate(ROUTES.SETTINGS_WALLET_CARD_DIGITAL_DETAILS_UPDATE_ADDRESS.getRoute(domain));
}}
limitType={card?.nameValuePairs?.limitType}
cardHintText={getCardHintText(
card?.nameValuePairs?.validFrom,
card?.nameValuePairs?.validThru,
personalDetails?.[card?.accountID ?? CONST.DEFAULT_NUMBER_ID]?.timezone?.selected,
translate,
)}
/>
Comment on lines 453 to 456

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve virtual card limit type on combo pages

When the Wallet entry opens a grouped physical+virtual card via the physical card ID, currentCard is the physical card while this virtualCards.map renders the companion virtual card. The top-level “Limit type” row above is therefore for currentCard, not for this revealed virtual card, so dropping the card.nameValuePairs.limitType data here removes the virtual card’s own limit type/dates after reveal rather than only removing a duplicate. Please keep rendering the virtual card’s limit metadata when the revealed card is not the current card, or otherwise conditionally suppress only the true duplicate case.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Interesting. @flaviadefaria how can I have a grouped physical card with multiple virtual cards?

Are their limit type can be different?

) : (
<>
Expand Down
18 changes: 1 addition & 17 deletions src/pages/settings/Wallet/WalletPage/CardDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@ import TextLink from '@components/TextLink';
import useLocalize from '@hooks/useLocalize';
import useOnyx from '@hooks/useOnyx';
import useThemeStyles from '@hooks/useThemeStyles';
import {getTranslationKeyForLimitType} from '@libs/CardUtils';
import {getFormattedAddress} from '@libs/PersonalDetailsUtils';
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
import type {PrivatePersonalDetails} from '@src/types/onyx';
import type {CardLimitType} from '@src/types/onyx/Card';

const defaultPrivatePersonalDetails: PrivatePersonalDetails = {
addresses: [
Expand All @@ -36,15 +34,9 @@ type CardDetailsProps = {

/** Callback to navigate to update address page */
onUpdateAddressPress?: () => void;

/** Card limit type */
limitType?: CardLimitType;

/** Hint text for the card */
cardHintText?: string;
};

function CardDetails({pan = '', expiration = '', cvv = '', onUpdateAddressPress, cardHintText, limitType}: CardDetailsProps) {
function CardDetails({pan = '', expiration = '', cvv = '', onUpdateAddressPress}: CardDetailsProps) {
const styles = useThemeStyles();
const {translate} = useLocalize();
const [privatePersonalDetails] = useOnyx(ONYXKEYS.PRIVATE_PERSONAL_DETAILS);
Expand All @@ -61,14 +53,6 @@ function CardDetails({pan = '', expiration = '', cvv = '', onUpdateAddressPress,
forwardedFSClass={CONST.FULLSTORY.CLASS.MASK}
/>
)}
{!!limitType && (
<MenuItemWithTopDescription
description={translate('workspace.card.issueNewCard.limitType')}
title={translate(getTranslationKeyForLimitType(limitType))}
interactive={false}
hintText={cardHintText}
/>
)}
{expiration?.length > 0 && (
<MenuItemWithTopDescription
description={translate('cardPage.cardDetails.expiration')}
Expand Down
Loading