diff --git a/src/components/Global/Badges/StatusBadge.tsx b/src/components/Global/Badges/StatusBadge.tsx index 0aebee174..1f37ab48a 100644 --- a/src/components/Global/Badges/StatusBadge.tsx +++ b/src/components/Global/Badges/StatusBadge.tsx @@ -30,8 +30,9 @@ const StatusBadge: React.FC = ({ status, className, size = 'sm return 'bg-secondary-4 text-yellow-6 border border-yellow-7' case 'failed': case 'cancelled': - case 'refunded': return 'bg-error-1 text-error border border-error-2' + case 'refunded': + return 'bg-secondary-4 text-yellow-6 border border-yellow-7' case 'soon': case 'custom': return 'bg-primary-3 text-primary-4' diff --git a/src/components/Global/Icons/Icon.tsx b/src/components/Global/Icons/Icon.tsx index faf8bafb9..5ec925560 100644 --- a/src/components/Global/Icons/Icon.tsx +++ b/src/components/Global/Icons/Icon.tsx @@ -66,6 +66,7 @@ import { WarningRounded, SpeedRounded, InfoRounded, + UndoRounded, } from '@mui/icons-material' import { DocsIcon } from './docs' import { PeanutSupportIcon } from './peanut-support' @@ -148,6 +149,7 @@ export type IconName = | 'split' | 'globe-lock' | 'bulb' + | 'undo' | 'upload-cloud' | 'alert-filled' | 'paste' @@ -288,6 +290,7 @@ const iconComponents: Record>> = 'txn-off': TxnOffIcon, docs: DocsIcon, bulb: BulbIcon, + undo: (props) => , 'upload-cloud': (props) => , 'invite-heart': InviteHeartIcon, 'alert-filled': (props) => , diff --git a/src/components/Global/StatusPill/index.tsx b/src/components/Global/StatusPill/index.tsx index 269888fe7..4f7f45a40 100644 --- a/src/components/Global/StatusPill/index.tsx +++ b/src/components/Global/StatusPill/index.tsx @@ -13,7 +13,7 @@ const StatusPill = ({ status }: StatusPillProps) => { completed: 'border-success-5 bg-success-2 text-success-4', pending: 'border-yellow-8 bg-secondary-4 text-yellow-6', cancelled: 'border-error-2 bg-error-1 text-error', - refunded: 'border-error-2 bg-error-1 text-error', + refunded: 'border-yellow-8 bg-secondary-4 text-yellow-6', failed: 'border-error-2 bg-error-1 text-error', processing: 'border-yellow-8 bg-secondary-4 text-yellow-6', soon: 'border-yellow-8 bg-secondary-4 text-yellow-6', @@ -27,7 +27,7 @@ const StatusPill = ({ status }: StatusPillProps) => { soon: 'pending', pending: 'pending', cancelled: 'cancel', - refunded: 'cancel', + refunded: 'undo', closed: 'success', } @@ -38,7 +38,7 @@ const StatusPill = ({ status }: StatusPillProps) => { soon: 7, pending: 8, cancelled: 6, - refunded: 6, + refunded: 8, closed: 7, } diff --git a/src/components/TransactionDetails/TransactionCard.tsx b/src/components/TransactionDetails/TransactionCard.tsx index aeb22bd3a..f6761b7f3 100644 --- a/src/components/TransactionDetails/TransactionCard.tsx +++ b/src/components/TransactionDetails/TransactionCard.tsx @@ -182,9 +182,13 @@ const TransactionCard: React.FC = ({ {/* display the action icon and type text */}
- {!isTestTransaction && getActionIcon(type, transaction.direction)} + {!isTestTransaction && getActionIcon(type, transaction.direction, status)} - {isTestTransaction ? 'Setup' : isPerkReward ? 'Cashback' : getActionText(type)} + {isTestTransaction + ? 'Setup' + : isPerkReward + ? 'Cashback' + : getActionText(type, status)} {status && }
@@ -232,7 +236,15 @@ const TransactionCard: React.FC = ({ } // helper functions -function getActionIcon(type: TransactionType, direction: TransactionDirection): React.ReactNode { +function getActionIcon( + type: TransactionType, + direction: TransactionDirection, + status?: StatusPillType +): React.ReactNode { + if (status === 'refunded') { + return + } + let iconName: IconName | null = null let iconSize = 7 @@ -275,7 +287,9 @@ function getActionIcon(type: TransactionType, direction: TransactionDirection): return } -function getActionText(type: TransactionType): string { +function getActionText(type: TransactionType, status?: StatusPillType): string { + if (status === 'refunded') return 'Refund' + let actionText: string = type switch (type) { case 'bank_withdraw': diff --git a/src/components/TransactionDetails/TransactionDetailsReceipt.tsx b/src/components/TransactionDetails/TransactionDetailsReceipt.tsx index 03544ebc3..e35ef7a72 100644 --- a/src/components/TransactionDetails/TransactionDetailsReceipt.tsx +++ b/src/components/TransactionDetails/TransactionDetailsReceipt.tsx @@ -160,7 +160,9 @@ export const TransactionDetailsReceipt = ({ !( transaction.extraDataForDrawer?.originalType === EHistoryEntryType.SEND_LINK && transaction.extraDataForDrawer?.originalUserRole === EHistoryUserRole.SENDER - ) + ) && + // hide token and network for refunded entries + transaction.status !== 'refunded' ), txId: !!transaction.txHash, // show cancelled row if status is cancelled, use cancelledDate or fallback to createdAt @@ -1291,7 +1293,7 @@ export const TransactionDetailsReceipt = ({ )} - {isQRPayment && ( + {isQRPayment && transaction.status !== 'refunded' && (