diff --git a/clients/banking/src/components/CardItemArea.tsx b/clients/banking/src/components/CardItemArea.tsx index 5eec8045d..f77d29a77 100644 --- a/clients/banking/src/components/CardItemArea.tsx +++ b/clients/banking/src/components/CardItemArea.tsx @@ -54,7 +54,7 @@ export const CardItemArea = ({ accountMembershipId, userId, cardId, large = true "AccountCardsItemOrderAddress", ]); - const { canPrintPhysicalCard } = usePermissions(); + const { canPrintPhysicalCard, canReadOtherMembersCards } = usePermissions(); const [data, { refresh }] = useQuery(CardPageDocument, { cardId }); useCrumb( @@ -135,8 +135,12 @@ export const CardItemArea = ({ accountMembershipId, userId, cardId, large = true }, ] : []), - ...match({ isCurrentUserCardOwner, card }) + ...match({ isCurrentUserCardOwner, card, canReadOtherMembersCards }) .with( + { + canReadOtherMembersCards: true, + card: { type: P.not("SingleUseVirtual") }, + }, { isCurrentUserCardOwner: true, card: { type: P.not("SingleUseVirtual") } }, () => [ { @@ -229,6 +233,7 @@ export const CardItemArea = ({ accountMembershipId, userId, cardId, large = true { refresh(); diff --git a/clients/banking/src/components/CardItemMobilePayment.tsx b/clients/banking/src/components/CardItemMobilePayment.tsx index 2abbb47cb..7cc1c25c4 100644 --- a/clients/banking/src/components/CardItemMobilePayment.tsx +++ b/clients/banking/src/components/CardItemMobilePayment.tsx @@ -43,9 +43,11 @@ type CompleteDigitalCard = DigitalCardFragment & { __typename: "CompleteDigitalC const DigitalCardTile = ({ digitalCard, + isCurrentUserCardOwner, onPressCancel, }: { digitalCard: CompleteDigitalCard; + isCurrentUserCardOwner: boolean; onPressCancel: () => void; }) => { const deviceName = digitalCard.device.name ?? t("card.mobilePayment.unnamed"); @@ -84,14 +86,16 @@ const DigitalCardTile = ({ - - - + {isCurrentUserCardOwner && ( + + + + )} ); @@ -99,10 +103,15 @@ const DigitalCardTile = ({ type Props = { card: Card; + isCurrentUserCardOwner: boolean; onRefreshRequest: () => void; }; -export const CardItemMobilePayment = ({ card, onRefreshRequest }: Props) => { +export const CardItemMobilePayment = ({ + card, + onRefreshRequest, + isCurrentUserCardOwner, +}: Props) => { const [cancelConfirmationModalModal, setCancelConfirmationModalModal] = useState< Option >(Option.None()); @@ -152,6 +161,7 @@ export const CardItemMobilePayment = ({ card, onRefreshRequest }: Props) => { digitalCards.map(digitalCard => ( setCancelConfirmationModalModal(Option.Some(digitalCard))} />