diff --git a/landing/src/hooks/use-season-start.tsx b/landing/src/hooks/use-season-start.tsx index 18d33ab07..b49fbc8b7 100644 --- a/landing/src/hooks/use-season-start.tsx +++ b/landing/src/hooks/use-season-start.tsx @@ -1,23 +1,24 @@ import { configManager } from "@/dojo/setup"; -import { useState } from "react"; +import { useEffect, useState } from "react"; export const useSeasonStart = () => { const seasonStart = BigInt(configManager.getSeasonConfig().startAt || 0); const nextBlockTimestamp = BigInt(Math.floor(Date.now() / 1000)); const [countdown, setCountdown] = useState(0n); - // useEffect(() => { - // if (nextBlockTimestamp === 0n || seasonStart === 0n) return; - // const initialCountdown = seasonStart - nextBlockTimestamp; - // setCountdown(initialCountdown); + useEffect(() => { + if (nextBlockTimestamp === 0n || seasonStart === 0n) return; - // const timer = setInterval(() => { - // setCountdown((prev) => prev - 1n); - // }, 1000); + const initialCountdown = seasonStart - nextBlockTimestamp; + setCountdown(initialCountdown); - // return () => clearInterval(timer); - // }, [nextBlockTimestamp, seasonStart]); + const timer = setInterval(() => { + setCountdown((prev) => prev - 1n); + }, 1000); + + return () => clearInterval(timer); + }, [nextBlockTimestamp, seasonStart]); return { seasonStart, countdown, nextBlockTimestamp }; }; diff --git a/landing/src/routes/index.lazy.tsx b/landing/src/routes/index.lazy.tsx index aa7ba5a7a..3fc9d35bc 100644 --- a/landing/src/routes/index.lazy.tsx +++ b/landing/src/routes/index.lazy.tsx @@ -1,7 +1,12 @@ import { AnimatedGrid } from "@/components/modules/animated-grid"; import { DataCard, DataCardProps } from "@/components/modules/data-card"; import { Leaderboard } from "@/components/modules/leaderboard"; -import { PRIZE_POOL_ACHIEVEMENTS, PRIZE_POOL_GUILDS, PRIZE_POOL_INDIVIDUAL_LEADERBOARD } from "@/constants"; +import { + PRIZE_POOL_ACHIEVEMENTS, + PRIZE_POOL_CONTENT_CREATORS, + PRIZE_POOL_GUILDS, + PRIZE_POOL_INDIVIDUAL_LEADERBOARD, +} from "@/constants"; import { useDonkeysBurned } from "@/hooks/use-donkeys-burned"; import { useLordsBridgeBalance } from "@/hooks/use-lords-bridged"; import { usePlayerCount } from "@/hooks/use-player-count"; @@ -81,7 +86,8 @@ function Index() { PRIZE_POOL_GUILDS + Number(formatEther(prizePoolPlayers)) + PRIZE_POOL_ACHIEVEMENTS + - PRIZE_POOL_INDIVIDUAL_LEADERBOARD, + PRIZE_POOL_INDIVIDUAL_LEADERBOARD + + PRIZE_POOL_CONTENT_CREATORS, 0, ), icon: ,