Skip to content

Commit 8bf1d2d

Browse files
committed
add future bearer placeholders
1 parent a68a507 commit 8bf1d2d

File tree

2 files changed

+62
-15
lines changed

2 files changed

+62
-15
lines changed

app/[locale]/10years/_components/TorchHistoryCard.tsx

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ interface TorchHistoryCardProps {
2222
transactionHash: string
2323
className?: string
2424
isCurrentHolder?: boolean
25+
isPlaceholder?: boolean
2526
}
2627

2728
const TorchHistoryCard: React.FC<TorchHistoryCardProps> = ({
@@ -33,12 +34,14 @@ const TorchHistoryCard: React.FC<TorchHistoryCardProps> = ({
3334
transactionHash,
3435
className,
3536
isCurrentHolder,
37+
isPlaceholder = false,
3638
}) => {
3739
return (
3840
<Card
3941
className={cn(
4042
"flex flex-col rounded-xl border border-gray-100/50 bg-gradient-to-b from-white to-gray-100 px-6 py-12 shadow-lg dark:text-body-inverse",
4143
isCurrentHolder && "bg-gradient-to-b from-[#B38DF0] to-[#DED4ED]",
44+
isPlaceholder && "bg-gradient-to-b from-gray-100 to-gray-200",
4245
className
4346
)}
4447
>
@@ -67,12 +70,19 @@ const TorchHistoryCard: React.FC<TorchHistoryCardProps> = ({
6770
</CardHeader>
6871
<CardContent className="flex flex-col gap-1 p-0">
6972
<div>{role}</div>
70-
<div className="text-xs text-body-medium">
71-
From {formatDate(from)} to {formatDate(to)}
72-
</div>
73-
<BaseLink href={getEtherscanUrl(transactionHash)} className="text-xs">
74-
View on Etherscan
75-
</BaseLink>
73+
{!isPlaceholder && (
74+
<>
75+
<div className="text-xs text-body-medium">
76+
From {formatDate(from)} to {formatDate(to)}
77+
</div>
78+
<BaseLink
79+
href={getEtherscanUrl(transactionHash)}
80+
className="text-xs"
81+
>
82+
View on Etherscan
83+
</BaseLink>
84+
</>
85+
)}
7686
</CardContent>
7787
</Card>
7888
)

app/[locale]/10years/_components/TorchHistorySwiper.tsx

Lines changed: 46 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,44 @@ const TorchHistorySwiper = ({
2727
(holder) => holder.address === currentHolderAddress
2828
)
2929

30+
// Create an array of 10 items, filling with placeholders for future holders
31+
const totalCards = 10
32+
const allCards = Array.from({ length: totalCards }, (_, index) => {
33+
if (index < holders.length) {
34+
// Use actual holder data
35+
return {
36+
...holders[index],
37+
isPlaceholder: false,
38+
}
39+
} else {
40+
// Create placeholder for future holder
41+
return {
42+
address: `placeholder-${index}` as Address,
43+
name: `Future Bearer ${index + 1}`,
44+
role: "Coming soon...",
45+
twitter: "",
46+
event: {
47+
from: "0x0000000000000000000000000000000000000000" as Address,
48+
to: `placeholder-${index}` as Address,
49+
blockNumber: BigInt(0),
50+
transactionHash: "",
51+
timestamp: 0,
52+
},
53+
isPlaceholder: true,
54+
}
55+
}
56+
})
57+
3058
return (
3159
<SwiperContainer className="w-full">
3260
<Swiper
3361
effect="coverflow"
3462
grabCursor
3563
centeredSlides
3664
slidesPerView="auto"
37-
initialSlide={currentHolderIndex || holders.length - 1}
65+
initialSlide={
66+
currentHolderIndex >= 0 ? currentHolderIndex : holders.length - 1
67+
}
3868
coverflowEffect={{
3969
rotate: 0,
4070
stretch: -50,
@@ -45,20 +75,27 @@ const TorchHistorySwiper = ({
4575
modules={[EffectCoverflow, Navigation]}
4676
className="w-full"
4777
>
48-
{holders.map((holder, idx) => (
78+
{allCards.map((card, idx) => (
4979
<SwiperSlide
5080
key={idx}
5181
className="flex !min-h-[400px] !w-60 justify-center"
5282
>
5383
<TorchHistoryCard
5484
className="!min-h-[400px]"
55-
name={holder.name}
56-
role={holder.role}
57-
avatar={getBlockieImage(holder.address)}
58-
from={holder.event.timestamp}
59-
to={holder.event.timestamp}
60-
transactionHash={holder.event.transactionHash}
61-
isCurrentHolder={holder.address === currentHolderAddress}
85+
name={card.name}
86+
role={card.role}
87+
avatar={
88+
card.isPlaceholder
89+
? "/images/10-year-anniversary/torch-cover.webp"
90+
: getBlockieImage(card.address)
91+
}
92+
from={card.event.timestamp}
93+
to={card.event.timestamp}
94+
transactionHash={card.event.transactionHash}
95+
isCurrentHolder={
96+
!card.isPlaceholder && card.address === currentHolderAddress
97+
}
98+
isPlaceholder={card.isPlaceholder}
6299
/>
63100
</SwiperSlide>
64101
))}

0 commit comments

Comments
 (0)