diff --git a/app/[locale]/10years/_components/TorchHistoryCard.tsx b/app/[locale]/10years/_components/TorchHistoryCard.tsx index 9419b1fca3b..c60c4ea252b 100644 --- a/app/[locale]/10years/_components/TorchHistoryCard.tsx +++ b/app/[locale]/10years/_components/TorchHistoryCard.tsx @@ -19,7 +19,7 @@ interface TorchHistoryCardProps { avatar: string twitter: string from: number - to: number + to?: number transactionHash: string className?: string isCurrentHolder?: boolean @@ -78,7 +78,8 @@ const TorchHistoryCard: React.FC = ({ {!isPlaceholder && ( <>
- From {formatDate(from)} to {formatDate(to)} + From {formatDate(from)} + {to !== undefined ? ` to ${formatDate(to)}` : " to present"}
- {allCards.map((card, idx) => ( - - - - ))} + {allCards.map((card, idx) => { + // For past holders, "to" is the timestamp of the next holder's event. + // For the current holder, "to" is undefined to signify "present". + // For placeholders, "to" is the same as "from" (0). + const toTimestamp = + !card.isPlaceholder && idx < holders.length - 1 + ? holders[idx + 1].event.timestamp + : card.isPlaceholder + ? card.event.timestamp + : undefined + + return ( + + + + ) + })}