diff --git a/src/components/TransactionCard.tsx b/src/components/TransactionCard.tsx index 5f39de31..ef14228f 100644 --- a/src/components/TransactionCard.tsx +++ b/src/components/TransactionCard.tsx @@ -86,6 +86,18 @@ export default function TransactionCard({ onPress, transaction, unit }: IProps) } } + const getDescription = () => { + if (!description || !description.length) { + return "No description"; + } + + if (description.length > 120) { + return `${description.substring(0, 100)}...`; + } + + return description; + }; + return ( onPress(transaction.rHash)}> @@ -158,7 +170,7 @@ export default function TransactionCard({ onPress, transaction, unit }: IProps) {recipientOrSender}:{" "} )} - {description && description.length !== 0 ? description : "No description"} + {getDescription()} {statusLabel}