Skip to content

Commit c5a4fe9

Browse files
committed
cleanup unused code after 10y event
1 parent 34e4346 commit c5a4fe9

File tree

7 files changed

+61
-796
lines changed

7 files changed

+61
-796
lines changed

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

Lines changed: 56 additions & 110 deletions
Original file line numberDiff line numberDiff line change
@@ -1,129 +1,75 @@
1-
"use client"
2-
3-
import { useMemo, useState } from "react"
4-
51
import { Alert, AlertContent, AlertTitle } from "@/components/ui/alert"
62
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"
73

84
import { cn } from "@/lib/utils/cn"
95

10-
import CountDown from "../CountDown"
11-
12-
import Connection from "./Connection"
13-
import GasFeeInformation from "./GasFeeInformation"
14-
156
import Curved10YearsText from "@/public/images/10-year-anniversary/10y-curved-heading.svg"
167

178
interface NFTMintCardProps {
189
className?: string
1910
}
2011

21-
const endTimestamp = process.env.NEXT_PUBLIC_MINT_TIMESTAMP_END
22-
23-
if (!endTimestamp) {
24-
throw new Error("NEXT_PUBLIC_MINT_TIMESTAMP_END is not set")
25-
}
26-
2712
const NFTMintCard = ({ className }: NFTMintCardProps) => {
28-
const endDateTime = useMemo(() => {
29-
return new Date(Number(endTimestamp) * 1000).toISOString()
30-
}, [])
31-
32-
const [isExpired, setIsExpired] = useState(false)
33-
34-
const handleExpired = () => {
35-
setIsExpired(true)
36-
}
37-
3813
return (
39-
<>
40-
<Card
41-
className={cn(
42-
"w-full overflow-hidden rounded-3xl bg-gradient-to-b from-[#A66BFF20] to-[#EED9FE16] shadow-lg",
43-
className
44-
)}
45-
>
46-
<CardHeader className="gap-4 pb-0">
47-
<div className="relative">
48-
{/* Torch/flame video */}
49-
<div className="flex items-center justify-center pt-12">
50-
<div className="relative max-h-[200px] max-w-[200px] overflow-hidden rounded-full border-4 border-white bg-white">
51-
<video
52-
className="pointer-events-none h-full w-full select-none rounded-full object-cover"
53-
src="/videos/10y-video.mp4"
54-
aria-label="10th anniversary video"
55-
autoPlay
56-
loop
57-
muted
58-
poster="/images/10-year-anniversary/10y-cover.png"
59-
controlsList="nodownload"
60-
disablePictureInPicture
61-
playsInline
62-
/>
63-
</div>
14+
<Card
15+
className={cn(
16+
"w-full overflow-hidden rounded-3xl bg-gradient-to-b from-[#A66BFF20] to-[#EED9FE16] shadow-lg",
17+
className
18+
)}
19+
>
20+
<CardHeader className="gap-4 pb-0">
21+
<div className="relative">
22+
{/* Torch/flame video */}
23+
<div className="flex items-center justify-center pt-12">
24+
<div className="relative max-h-[200px] max-w-[200px] overflow-hidden rounded-full border-4 border-white bg-white">
25+
<video
26+
className="pointer-events-none h-full w-full select-none rounded-full object-cover"
27+
src="/videos/10y-video.mp4"
28+
aria-label="10th anniversary video"
29+
autoPlay
30+
loop
31+
muted
32+
poster="/images/10-year-anniversary/10y-cover.png"
33+
controlsList="nodownload"
34+
disablePictureInPicture
35+
playsInline
36+
/>
6437
</div>
65-
66-
{/* Curved text */}
67-
<Curved10YearsText
68-
viewBox="0 0 313 186"
69-
className="absolute left-1/2 top-0 h-min w-full max-w-[300px] -translate-x-1/2 fill-primary"
70-
width="100%"
71-
height="auto"
72-
/>
7338
</div>
7439

75-
<CardTitle className="text-center">Mint the moment</CardTitle>
76-
</CardHeader>
77-
78-
<CardContent className="space-y-6 p-6 text-center">
79-
<p className="text-body-medium">
80-
Celebrate a decade of decentralization with a free, limited-time
81-
10th anniversary NFT. Mint yours before time runs out.
82-
</p>
83-
84-
{isExpired ? (
85-
<Alert
86-
variant="update"
87-
className="w-full rounded-none border-none text-center"
88-
>
89-
<AlertContent>
90-
<AlertTitle className="!text-primary">
91-
The claim period has ended
92-
</AlertTitle>
93-
<p className="text-primary">
94-
Thank you all for joining the celebration
95-
</p>
96-
</AlertContent>
97-
</Alert>
98-
) : (
99-
<>
100-
<div className="space-y-2">
101-
<CountDown
102-
className="text-primary"
103-
dateTime={endDateTime}
104-
onExpired={handleExpired}
105-
hideZeroUnits
106-
timeLeftLabels={{
107-
days: { singular: "day", plural: "days" },
108-
hours: { singular: "hour", plural: "hours" },
109-
minutes: { singular: "minute", plural: "minutes" },
110-
seconds: { singular: "second", plural: "seconds" },
111-
}}
112-
expiredLabel="Minting has ended"
113-
/>
114-
<p className="text-sm text-body-medium">
115-
Time remaining to mint
116-
</p>
117-
</div>
118-
119-
<GasFeeInformation />
120-
121-
<Connection />
122-
</>
123-
)}
124-
</CardContent>
125-
</Card>
126-
</>
40+
{/* Curved text */}
41+
<Curved10YearsText
42+
viewBox="0 0 313 186"
43+
className="absolute left-1/2 top-0 h-min w-full max-w-[300px] -translate-x-1/2 fill-primary"
44+
width="100%"
45+
height="auto"
46+
/>
47+
</div>
48+
49+
<CardTitle className="text-center">Mint the moment</CardTitle>
50+
</CardHeader>
51+
52+
<CardContent className="space-y-6 p-6 text-center">
53+
<p className="text-body-medium">
54+
Celebrate a decade of decentralization with a free, limited-time 10th
55+
anniversary NFT. Mint yours before time runs out.
56+
</p>
57+
58+
<Alert
59+
variant="update"
60+
className="w-full rounded-none border-none text-center"
61+
>
62+
<AlertContent>
63+
<AlertTitle className="!text-primary">
64+
The claim period has ended
65+
</AlertTitle>
66+
<p className="text-primary">
67+
Thank you all for joining the celebration
68+
</p>
69+
</AlertContent>
70+
</Alert>
71+
</CardContent>
72+
</Card>
12773
)
12874
}
12975

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

Lines changed: 0 additions & 40 deletions
This file was deleted.

app/[locale]/10years/_components/utils/nftMintDate.ts

Lines changed: 0 additions & 22 deletions
This file was deleted.

app/[locale]/10years/page.tsx

Lines changed: 5 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -27,34 +27,30 @@ import torchHoldersData from "@/data/torchHolders.json"
2727

2828
import { BASE_TIME_UNIT } from "@/lib/constants"
2929

30-
import Curved10YearsText from "./_components/10y.svg"
3130
import AdoptionSwiper from "./_components/AdoptionSwiper/lazy"
32-
import CountDown from "./_components/CountDown/lazy"
3331
import { adoptionStyles } from "./_components/data"
3432
import InnovationSwiper from "./_components/InnovationSwiper/lazy"
35-
import NFTMintCardWrapper from "./_components/NFTMintCardWrapper"
33+
import NFTMintCard from "./_components/NFTMintCard"
3634
import TenYearHero from "./_components/TenYearHero"
3735
import TorchHistorySwiper from "./_components/TorchHistorySwiper/lazy"
3836
import Stories from "./_components/UserStories/lazy"
3937
import {
4038
getAdoptionCards,
4139
getInnovationCards,
42-
getTimeUnitTranslations,
4340
parseStoryDates,
4441
} from "./_components/utils"
45-
import { shouldShowNFTMintCard } from "./_components/utils/nftMintDate"
4642

4743
import { routing } from "@/i18n/routing"
4844
import { fetch10YearEvents } from "@/lib/api/fetch10YearEvents"
4945
import { fetch10YearStories } from "@/lib/api/fetch10YearStories"
5046
import {
51-
getCurrentHolder,
5247
getHolderEvents,
5348
getTransferEvents,
5449
isAddressFiltered,
5550
type TorchHolder,
5651
} from "@/lib/torch"
5752
import TenYearLogo from "@/public/images/10-year-anniversary/10-year-logo.png"
53+
import Curved10YearsText from "@/public/images/10-year-anniversary/10y-torch-heading.svg"
5854

5955
// In seconds
6056
const REVALIDATE_TIME = BASE_TIME_UNIT * 1
@@ -90,7 +86,6 @@ const Page = async ({ params }: { params: Promise<{ locale: Lang }> }) => {
9086
namespace: "page-10-year-anniversary",
9187
})
9288

93-
const timeLeftLabels = await getTimeUnitTranslations()
9489
const innovationCards = await getInnovationCards()
9590
const adoptionCards = await getAdoptionCards()
9691

@@ -116,27 +111,13 @@ const Page = async ({ params }: { params: Promise<{ locale: Lang }> }) => {
116111
(holder) => !isAddressFiltered(holder.address)
117112
)
118113

119-
const currentHolder = getCurrentHolder(torchHolders)
120-
const showNFTMint = shouldShowNFTMintCard()
121-
122114
return (
123115
<MainArticle className="mx-auto flex w-full flex-col items-center">
124116
<TenYearHero locale={locale} />
125117

126-
{!showNFTMint && (
127-
<div className="w-full px-8 py-12">
128-
<CountDown
129-
dateTime="2025-07-30T15:26:13Z"
130-
timeLeftLabels={timeLeftLabels}
131-
expiredLabel={t("page-10-year-countdown-expired")}
132-
/>
133-
</div>
134-
)}
135-
136118
<div
137119
className={cn(
138-
"mt-16 flex w-full max-w-screen-xl flex-col gap-32 px-4 py-4 md:flex-row md:py-8",
139-
showNFTMint && "max-w-none"
120+
"mt-16 flex w-full flex-col gap-32 px-4 py-4 md:flex-row md:py-8"
140121
)}
141122
>
142123
<div className="flex flex-1 flex-col gap-5">
@@ -152,7 +133,7 @@ const Page = async ({ params }: { params: Promise<{ locale: Lang }> }) => {
152133
</div>
153134
</div>
154135
<div className="flex flex-1 flex-row items-center justify-center">
155-
<NFTMintCardWrapper locale={locale} />
136+
<NFTMintCard />
156137
</div>
157138
</div>
158139

@@ -298,7 +279,7 @@ const Page = async ({ params }: { params: Promise<{ locale: Lang }> }) => {
298279

299280
<TorchHistorySwiper
300281
holders={torchHolders}
301-
currentHolderAddress={currentHolder?.address || null}
282+
currentHolderAddress={null}
302283
/>
303284

304285
<div className="flex flex-col gap-12 px-8 pb-24 pt-12 text-body-inverse sm:px-16 md:flex-row dark:text-body">

0 commit comments

Comments
 (0)