Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions src/components/landing/ProjectStats.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ interface StatContentProps {
isMobile: boolean;
}

function yearsSinceBeanstalkLaunch(today = new Date()) {
const year = today.getUTCFullYear();
const anniversary = Date.UTC(year, 7, 6);
return year - 2021 - Number(today.getTime() < anniversary);
}

function StatContent({ activeButton, isMobile }: StatContentProps) {
const contentRef = useRef<HTMLDivElement>(null);

Expand Down Expand Up @@ -172,8 +178,7 @@ export default function ProjectStats() {
<span
className={`text-[2rem] sm:text-[4rem] leading-[1.4] text-black transition-all duration-300 ${getElementOpacity(activeButton === "upgrades")}`}
>
{/* Protocol Upgrades + Pinto Launch (+1)*/}
{PROTOCOL_UPGRADES.length + 1}
{PROTOCOL_UPGRADES.length}
</span>
<Button
variant={"outline-rounded"}
Expand Down Expand Up @@ -245,7 +250,7 @@ export default function ProjectStats() {
<span
className={`text-[2rem] sm:text-[4rem] leading-[1.4] text-black transition-all duration-300 ${getElementOpacity(activeButton === "years")}`}
>
4+
{yearsSinceBeanstalkLaunch()}+
</span>
<Button
variant={"outline-rounded"}
Expand Down
Loading