Skip to content

Commit 75a7659

Browse files
authored
Merge pull request #15900 from ethereum/fixTorchCardCopy
Improve torch card placeholder copy
2 parents c46ea10 + de8edf9 commit 75a7659

File tree

1 file changed

+18
-2
lines changed
  • app/[locale]/10years/_components/TorchHistorySwiper

1 file changed

+18
-2
lines changed

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

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,22 @@ type TorchHistorySwiperProps = {
1919
currentHolderAddress: Address | null
2020
}
2121

22+
const getOrdinalSuffix = (num: number): string => {
23+
const pr = new Intl.PluralRules("en", { type: "ordinal" })
24+
const rule = pr.select(num)
25+
26+
switch (rule) {
27+
case "one":
28+
return `${num}st`
29+
case "two":
30+
return `${num}nd`
31+
case "few":
32+
return `${num}rd`
33+
default:
34+
return `${num}th`
35+
}
36+
}
37+
2238
const TorchHistorySwiper = ({
2339
holders,
2440
currentHolderAddress,
@@ -40,8 +56,8 @@ const TorchHistorySwiper = ({
4056
// Create placeholder for future holder
4157
return {
4258
address: `placeholder-${index}` as Address,
43-
name: `Future Bearer ${index + 1}`,
44-
role: "Coming soon...",
59+
name: `Torchbearer ${index + 1}`,
60+
role: `Coming July ${getOrdinalSuffix(20 + index)}!`,
4561
twitter: "",
4662
event: {
4763
from: "0x0000000000000000000000000000000000000000" as Address,

0 commit comments

Comments
 (0)