Skip to content

Commit

Permalink
feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
sandrine-ds committed Jan 28, 2025
1 parent f17535c commit 80ee1b9
Showing 1 changed file with 19 additions and 27 deletions.
46 changes: 19 additions & 27 deletions clients/banking/src/components/CardItemArea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,45 +120,37 @@ export const CardItemArea = ({ accountMembershipId, userId, cardId, large = true
card.physicalCard?.statusInfo.__typename === "PhysicalCardToRenewStatusInfo" ||
card.physicalCard?.statusInfo.__typename === "PhysicalCardRenewedStatusInfo";

const physicalCardTab = {
label: t("cardDetail.physicalCard"),
url: Router.AccountCardsItemPhysicalCard({
accountMembershipId,
cardId,
}),
endElement: (
<Tag color="shakespear" size="small">
{match(card.physicalCard?.statusInfo.__typename)
.with("PhysicalCardToRenewStatusInfo", () => t("cards.expiringSoon"))
.with("PhysicalCardRenewedStatusInfo", () => t("cards.activateNewCard"))
.otherwise(() => undefined)}
</Tag>
),
};

return (
<>
<TabView
padding={large ? 40 : 24}
sticky={true}
tabs={[
...(shouldShowFirstPhysicalCard
? [
{
label: t("cardDetail.physicalCard"),
url: Router.AccountCardsItemPhysicalCard({
accountMembershipId,
cardId,
}),
endElement: (
<Tag color="shakespear" size="small">
{match(card.physicalCard?.statusInfo.__typename)
.with("PhysicalCardToRenewStatusInfo", () => t("cards.expiringSoon"))
.with("PhysicalCardRenewedStatusInfo", () => t("cards.activateNewCard"))
.otherwise(() => undefined)}
</Tag>
),
},
]
...(shouldShowFirstPhysicalCard && shouldShowFirstPhysicalCard
? [physicalCardTab]
: []),
{
label: t("cardDetail.virtualCard"),
url: Router.AccountCardsItem({ accountMembershipId, cardId }),
},
...(shouldShowPhysicalCardTab && !shouldShowFirstPhysicalCard
? [
{
label: t("cardDetail.physicalCard"),
url: Router.AccountCardsItemPhysicalCard({
accountMembershipId,
cardId,
}),
},
]
? [physicalCardTab]
: []),
...match({ isCurrentUserCardOwner, card, canReadOtherMembersCards })
.with(
Expand Down

0 comments on commit 80ee1b9

Please sign in to comment.