Skip to content
Merged
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
5 changes: 5 additions & 0 deletions .changeset/tame-foxes-add.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@clerk/clerk-js': patch
---

Display generic payment icon in payment source row when payment method is not card
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { CommercePaymentSourceResource } from '@clerk/types';

import { Badge, descriptors, Flex, Icon, localizationKeys, Text } from '../../customizables';
import { ApplePay, CreditCard } from '../../icons';
import { CreditCard, GenericPayment } from '../../icons';

export const PaymentSourceRow = ({ paymentSource }: { paymentSource: CommercePaymentSourceResource }) => {
return (
Expand All @@ -12,7 +12,7 @@ export const PaymentSourceRow = ({ paymentSource }: { paymentSource: CommercePay
elementDescriptor={descriptors.paymentSourceRow}
>
<Icon
icon={paymentSource.walletType === 'apple_pay' ? ApplePay : CreditCard}
icon={paymentSource.paymentMethod === 'card' ? CreditCard : GenericPayment}
sx={{ alignSelf: 'center' }}
elementDescriptor={descriptors.paymentSourceRowIcon}
/>
Expand All @@ -29,7 +29,7 @@ export const PaymentSourceRow = ({ paymentSource }: { paymentSource: CommercePay
truncate
elementDescriptor={descriptors.paymentSourceRowValue}
>
{paymentSource.paymentMethod === 'card' ? `⋯ ${paymentSource.last4}` : '-'}
{paymentSource.paymentMethod === 'card' ? `⋯ ${paymentSource.last4}` : null}
</Text>
{paymentSource.isDefault && (
<Badge
Expand Down
1 change: 1 addition & 0 deletions packages/clerk-js/src/ui/icons/generic-pay.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions packages/clerk-js/src/ui/icons/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export { default as Eye } from './eye.svg';
export { default as EyeSlash } from './eye-slash.svg';
export { default as Fingerprint } from './fingerprint.svg';
export { default as Folder } from './folder.svg';
export { default as GenericPayment } from './generic-pay.svg';
export { default as InformationCircle } from './information-circle.svg';
export { default as LinkIcon } from './link.svg';
export { default as LockClosedIcon } from './lock-closed.svg';
Expand Down
Loading