Skip to content
Merged
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
17 changes: 9 additions & 8 deletions src/components/TransactionDetails/TransactionDetailsReceipt.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ export const TransactionDetailsReceipt = ({
[rowVisibilityConfig]
)

// @dev TODO: Enable grouped borders when tackling receipt changes
// reusable helper to check if border should be hidden for a row in a specific group
const shouldHideGroupBorder = (rowKey: TransactionDetailsRowKey, groupName: keyof typeof rowGroups) => {
const isLastInGroup = rowKey === lastVisibleInGroups[groupName]
Expand Down Expand Up @@ -597,31 +598,31 @@ export const TransactionDetailsReceipt = ({
<PaymentInfoRow
label={'Created'}
value={formatDate(new Date(transaction.createdAt!.toString()))}
hideBottomBorder={shouldHideGroupBorder('createdAt', 'dateRows')}
hideBottomBorder={shouldHideBorder('createdAt')}
/>
)}

{rowVisibilityConfig.cancelled && (
<PaymentInfoRow
label="Cancelled"
value={formatDate(new Date(transaction.cancelledDate!))}
hideBottomBorder={shouldHideGroupBorder('cancelled', 'dateRows')}
hideBottomBorder={shouldHideBorder('cancelled')}
/>
)}

{rowVisibilityConfig.claimed && (
<PaymentInfoRow
label="Claimed"
value={formatDate(new Date(transaction.claimedAt!))}
hideBottomBorder={shouldHideGroupBorder('claimed', 'dateRows')}
hideBottomBorder={shouldHideBorder('claimed')}
/>
)}

{rowVisibilityConfig.completed && (
<PaymentInfoRow
label={getLabelText(transaction)}
value={formatDate(new Date(transaction.completedAt!))}
hideBottomBorder={shouldHideGroupBorder('completed', 'dateRows')}
hideBottomBorder={shouldHideBorder('completed')}
/>
)}

Expand Down Expand Up @@ -705,7 +706,7 @@ export const TransactionDetailsReceipt = ({
</div>
)
}
hideBottomBorder={shouldHideGroupBorder('tokenAndNetwork', 'txnDetails')}
hideBottomBorder={shouldHideBorder('tokenAndNetwork')}
/>
)}
</>
Expand All @@ -732,7 +733,7 @@ export const TransactionDetailsReceipt = ({
</div>
)
}
hideBottomBorder={shouldHideGroupBorder('txId', 'txnDetails')}
hideBottomBorder={shouldHideBorder('txId')}
/>
)}

Expand Down Expand Up @@ -1087,15 +1088,15 @@ export const TransactionDetailsReceipt = ({
label="Network fee"
value={transaction.networkFeeDetails!.amountDisplay}
moreInfoText={transaction.networkFeeDetails!.moreInfoText}
hideBottomBorder={shouldHideGroupBorder('networkFee', 'fees')}
hideBottomBorder={shouldHideBorder('networkFee')}
/>
)}

{rowVisibilityConfig.peanutFee && (
<PaymentInfoRow
label="Peanut fee"
value={'Sponsored by Peanut!'}
hideBottomBorder={shouldHideGroupBorder('peanutFee', 'fees')}
hideBottomBorder={shouldHideBorder('peanutFee')}
/>
)}

Expand Down
Loading