Skip to content

Commit edaf7f9

Browse files
authored
fix hero loading state (#430)
1 parent 4a4f951 commit edaf7f9

2 files changed

Lines changed: 6 additions & 15 deletions

File tree

app/(pages)/(hackers)/_components/HomeHacking/HeroHacking.tsx

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
import Image from 'next/image';
44
import { GoArrowRight } from 'react-icons/go';
5-
6-
import ClientTimeProtectedDisplay from '@pages/_components/TimeProtectedDisplay/ClientTimeProtectedDisplay';
75
import Countdown from './_components/Countdown';
86

97
interface HeroHackingProps {
@@ -17,6 +15,7 @@ export default function HeroHacking({
1715
rolloutTime,
1816
loading,
1917
}: HeroHackingProps) {
18+
// Adds one day to rollout time 'hacking-starts' AKA hacking ending time
2019
const countdownTarget = rolloutTime ? rolloutTime + ONE_DAY_MS : undefined;
2120

2221
return (
@@ -45,18 +44,10 @@ export default function HeroHacking({
4544
<div className="flex items-start justify-between gap-2">
4645
{/* Right: countdown (big) */}
4746
<div className="flex-1 flex justify-center">
48-
<div className="text-white">
49-
<ClientTimeProtectedDisplay
50-
featureId="hacking-starts"
51-
fallback={<Countdown />}
52-
>
53-
{countdownTarget !== undefined && (
54-
<Countdown countdownTarget={countdownTarget} />
55-
)}
56-
</ClientTimeProtectedDisplay>
57-
47+
<div className="text-white relative">
48+
<Countdown countdownTarget={countdownTarget} />
5849
{loading && (
59-
<div className="mt-2 text-white/90 text-sm text-right">
50+
<div className="absolute top-full mt-2 text-white/90 text-sm">
6051
loading…
6152
</div>
6253
)}

app/(pages)/(hackers)/_components/HomeHacking/_components/Countdown.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ interface CountdownProps {
66
countdownTarget?: number;
77
}
88

9-
const HACKING_ENDS_TIME = new Date('2026-05-10T11:00:00-07:00').getTime(); // May 10, 2026 at 11:00 AM PDT
9+
const FALLBACK_HACKING_ENDS = new Date('2026-05-10T11:00:00-07:00').getTime(); // May 10, 2026 at 11:00 AM PDT
1010

1111
export default function Countdown({
12-
countdownTarget = HACKING_ENDS_TIME,
12+
countdownTarget = FALLBACK_HACKING_ENDS,
1313
}: CountdownProps) {
1414
const [timeLeft, setTimeLeft] = useState({
1515
hours: 24,

0 commit comments

Comments
 (0)